From: Matt Corallo Date: Thu, 11 Feb 2021 17:59:07 +0000 (-0500) Subject: - bindings updates X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=82cf71199dcbd866177f5e91abb852cdc1d221e8;p=rust-lightning - bindings updates --- diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 2025fdf4f..6e21b0d21 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -1503,15 +1503,15 @@ typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ { bool result_ok; } LDKCResult_SpendableOutputDescriptorDecodeErrorZ; -typedef union LDKCResult_ChanKeySignerDecodeErrorZPtr { +typedef union LDKCResult_ChannelKeysDecodeErrorZPtr { struct LDKChannelKeys *result; struct LDKDecodeError *err; -} LDKCResult_ChanKeySignerDecodeErrorZPtr; +} LDKCResult_ChannelKeysDecodeErrorZPtr; -typedef struct LDKCResult_ChanKeySignerDecodeErrorZ { - union LDKCResult_ChanKeySignerDecodeErrorZPtr contents; +typedef struct LDKCResult_ChannelKeysDecodeErrorZ { + union LDKCResult_ChannelKeysDecodeErrorZPtr contents; bool result_ok; -} LDKCResult_ChanKeySignerDecodeErrorZ; +} LDKCResult_ChannelKeysDecodeErrorZ; @@ -1879,7 +1879,7 @@ typedef struct LDKKeysInterface { * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. */ - struct LDKCResult_ChanKeySignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader); + struct LDKCResult_ChannelKeysDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader); void (*free)(void *this_arg); } LDKKeysInterface; @@ -2443,25 +2443,25 @@ typedef struct LDKCResult_boolPeerHandleErrorZ { bool result_ok; } LDKCResult_boolPeerHandleErrorZ; -typedef union LDKCResult_SecretKeySecpErrorZPtr { +typedef union LDKCResult_SecretKeyErrorZPtr { struct LDKSecretKey *result; enum LDKSecp256k1Error *err; -} LDKCResult_SecretKeySecpErrorZPtr; +} LDKCResult_SecretKeyErrorZPtr; -typedef struct LDKCResult_SecretKeySecpErrorZ { - union LDKCResult_SecretKeySecpErrorZPtr contents; +typedef struct LDKCResult_SecretKeyErrorZ { + union LDKCResult_SecretKeyErrorZPtr contents; bool result_ok; -} LDKCResult_SecretKeySecpErrorZ; +} LDKCResult_SecretKeyErrorZ; -typedef union LDKCResult_PublicKeySecpErrorZPtr { +typedef union LDKCResult_PublicKeyErrorZPtr { struct LDKPublicKey *result; enum LDKSecp256k1Error *err; -} LDKCResult_PublicKeySecpErrorZPtr; +} LDKCResult_PublicKeyErrorZPtr; -typedef struct LDKCResult_PublicKeySecpErrorZ { - union LDKCResult_PublicKeySecpErrorZPtr contents; +typedef struct LDKCResult_PublicKeyErrorZ { + union LDKCResult_PublicKeyErrorZPtr contents; bool result_ok; -} LDKCResult_PublicKeySecpErrorZ; +} LDKCResult_PublicKeyErrorZ; @@ -2487,15 +2487,15 @@ typedef struct MUST_USE_STRUCT LDKTxCreationKeys { bool is_owned; } LDKTxCreationKeys; -typedef union LDKCResult_TxCreationKeysSecpErrorZPtr { +typedef union LDKCResult_TxCreationKeysErrorZPtr { struct LDKTxCreationKeys *result; enum LDKSecp256k1Error *err; -} LDKCResult_TxCreationKeysSecpErrorZPtr; +} LDKCResult_TxCreationKeysErrorZPtr; -typedef struct LDKCResult_TxCreationKeysSecpErrorZ { - union LDKCResult_TxCreationKeysSecpErrorZPtr contents; +typedef struct LDKCResult_TxCreationKeysErrorZ { + union LDKCResult_TxCreationKeysErrorZPtr contents; bool result_ok; -} LDKCResult_TxCreationKeysSecpErrorZ; +} LDKCResult_TxCreationKeysErrorZ; @@ -3586,13 +3586,13 @@ void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_ok(struct LDKChannelKeys o); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_ok(struct LDKChannelKeys o); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_err(struct LDKDecodeError e); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_err(struct LDKDecodeError e); -void CResult_ChanKeySignerDecodeErrorZ_free(struct LDKCResult_ChanKeySignerDecodeErrorZ _res); +void CResult_ChannelKeysDecodeErrorZ_free(struct LDKCResult_ChannelKeysDecodeErrorZ _res); -struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_clone(const struct LDKCResult_ChanKeySignerDecodeErrorZ *NONNULL_PTR orig); +struct LDKCResult_ChannelKeysDecodeErrorZ CResult_ChannelKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelKeysDecodeErrorZ *NONNULL_PTR orig); struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o); @@ -3826,23 +3826,23 @@ void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _r struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); -struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_ok(struct LDKSecretKey o); +struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o); -struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_err(enum LDKSecp256k1Error e); +struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e); -void CResult_SecretKeySecpErrorZ_free(struct LDKCResult_SecretKeySecpErrorZ _res); +void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); -struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_ok(struct LDKPublicKey o); +struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); -struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_err(enum LDKSecp256k1Error e); +struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); -void CResult_PublicKeySecpErrorZ_free(struct LDKCResult_PublicKeySecpErrorZ _res); +void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); -struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_ok(struct LDKTxCreationKeys o); +struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o); -struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_err(enum LDKSecp256k1Error e); +struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e); -void CResult_TxCreationKeysSecpErrorZ_free(struct LDKCResult_TxCreationKeysSecpErrorZ _res); +void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); @@ -7044,7 +7044,7 @@ struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); +struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); /** * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key) @@ -7054,7 +7054,7 @@ struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); +struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); /** * Derives a per-commitment-transaction revocation key from its constituent parts. @@ -7067,7 +7067,7 @@ struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_ * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); +struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); /** * Derives a per-commitment-transaction revocation public key from its constituent parts. This is @@ -7082,7 +7082,7 @@ struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_ * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -struct LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); +struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr); @@ -7230,13 +7230,13 @@ struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser); * Create per-state keys from channel base points and the per-commitment point. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ -MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); +MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); /** * Generate per-state keys from channel static keys. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ -MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); +MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); /** * A script either spendable by the revocation diff --git a/lightning-c-bindings/include/lightningpp.hpp b/lightning-c-bindings/include/lightningpp.hpp index 4e4fbb46a..0247bd922 100644 --- a/lightning-c-bindings/include/lightningpp.hpp +++ b/lightning-c-bindings/include/lightningpp.hpp @@ -1781,21 +1781,6 @@ public: const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator &() const { return &self; } const LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* operator ->() const { return &self; } }; -class CResult_TxCreationKeysSecpErrorZ { -private: - LDKCResult_TxCreationKeysSecpErrorZ self; -public: - CResult_TxCreationKeysSecpErrorZ(const CResult_TxCreationKeysSecpErrorZ&) = delete; - CResult_TxCreationKeysSecpErrorZ(CResult_TxCreationKeysSecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); } - CResult_TxCreationKeysSecpErrorZ(LDKCResult_TxCreationKeysSecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); } - operator LDKCResult_TxCreationKeysSecpErrorZ() && { LDKCResult_TxCreationKeysSecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); return res; } - ~CResult_TxCreationKeysSecpErrorZ() { CResult_TxCreationKeysSecpErrorZ_free(self); } - CResult_TxCreationKeysSecpErrorZ& operator=(CResult_TxCreationKeysSecpErrorZ&& o) { CResult_TxCreationKeysSecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); return *this; } - LDKCResult_TxCreationKeysSecpErrorZ* operator &() { return &self; } - LDKCResult_TxCreationKeysSecpErrorZ* operator ->() { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator &() const { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator ->() const { return &self; } -}; class CVec_RouteHintZ { private: LDKCVec_RouteHintZ self; @@ -1976,6 +1961,21 @@ public: const LDKCResult_QueryShortChannelIdsDecodeErrorZ* operator &() const { return &self; } const LDKCResult_QueryShortChannelIdsDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_SecretKeyErrorZ { +private: + LDKCResult_SecretKeyErrorZ self; +public: + CResult_SecretKeyErrorZ(const CResult_SecretKeyErrorZ&) = delete; + CResult_SecretKeyErrorZ(CResult_SecretKeyErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeyErrorZ)); } + CResult_SecretKeyErrorZ(LDKCResult_SecretKeyErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeyErrorZ)); } + operator LDKCResult_SecretKeyErrorZ() && { LDKCResult_SecretKeyErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeyErrorZ)); return res; } + ~CResult_SecretKeyErrorZ() { CResult_SecretKeyErrorZ_free(self); } + CResult_SecretKeyErrorZ& operator=(CResult_SecretKeyErrorZ&& o) { CResult_SecretKeyErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_SecretKeyErrorZ)); return *this; } + LDKCResult_SecretKeyErrorZ* operator &() { return &self; } + LDKCResult_SecretKeyErrorZ* operator ->() { return &self; } + const LDKCResult_SecretKeyErrorZ* operator &() const { return &self; } + const LDKCResult_SecretKeyErrorZ* operator ->() const { return &self; } +}; class CResult_NoneAPIErrorZ { private: LDKCResult_NoneAPIErrorZ self; @@ -2156,20 +2156,20 @@ public: const LDKC2Tuple_BlockHashChannelMonitorZ* operator &() const { return &self; } const LDKC2Tuple_BlockHashChannelMonitorZ* operator ->() const { return &self; } }; -class CResult_SecretKeySecpErrorZ { +class CResult_TxCreationKeysErrorZ { private: - LDKCResult_SecretKeySecpErrorZ self; + LDKCResult_TxCreationKeysErrorZ self; public: - CResult_SecretKeySecpErrorZ(const CResult_SecretKeySecpErrorZ&) = delete; - CResult_SecretKeySecpErrorZ(CResult_SecretKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); } - CResult_SecretKeySecpErrorZ(LDKCResult_SecretKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); } - operator LDKCResult_SecretKeySecpErrorZ() && { LDKCResult_SecretKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); return res; } - ~CResult_SecretKeySecpErrorZ() { CResult_SecretKeySecpErrorZ_free(self); } - CResult_SecretKeySecpErrorZ& operator=(CResult_SecretKeySecpErrorZ&& o) { CResult_SecretKeySecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); return *this; } - LDKCResult_SecretKeySecpErrorZ* operator &() { return &self; } - LDKCResult_SecretKeySecpErrorZ* operator ->() { return &self; } - const LDKCResult_SecretKeySecpErrorZ* operator &() const { return &self; } - const LDKCResult_SecretKeySecpErrorZ* operator ->() const { return &self; } + CResult_TxCreationKeysErrorZ(const CResult_TxCreationKeysErrorZ&) = delete; + CResult_TxCreationKeysErrorZ(CResult_TxCreationKeysErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysErrorZ)); } + CResult_TxCreationKeysErrorZ(LDKCResult_TxCreationKeysErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysErrorZ)); } + operator LDKCResult_TxCreationKeysErrorZ() && { LDKCResult_TxCreationKeysErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysErrorZ)); return res; } + ~CResult_TxCreationKeysErrorZ() { CResult_TxCreationKeysErrorZ_free(self); } + CResult_TxCreationKeysErrorZ& operator=(CResult_TxCreationKeysErrorZ&& o) { CResult_TxCreationKeysErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_TxCreationKeysErrorZ)); return *this; } + LDKCResult_TxCreationKeysErrorZ* operator &() { return &self; } + LDKCResult_TxCreationKeysErrorZ* operator ->() { return &self; } + const LDKCResult_TxCreationKeysErrorZ* operator &() const { return &self; } + const LDKCResult_TxCreationKeysErrorZ* operator ->() const { return &self; } }; class CResult_NodeAnnouncementInfoDecodeErrorZ { private: @@ -2291,21 +2291,6 @@ public: const LDKCVec_MonitorEventZ* operator &() const { return &self; } const LDKCVec_MonitorEventZ* operator ->() const { return &self; } }; -class CResult_ChanKeySignerDecodeErrorZ { -private: - LDKCResult_ChanKeySignerDecodeErrorZ self; -public: - CResult_ChanKeySignerDecodeErrorZ(const CResult_ChanKeySignerDecodeErrorZ&) = delete; - CResult_ChanKeySignerDecodeErrorZ(CResult_ChanKeySignerDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChanKeySignerDecodeErrorZ)); } - CResult_ChanKeySignerDecodeErrorZ(LDKCResult_ChanKeySignerDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChanKeySignerDecodeErrorZ)); } - operator LDKCResult_ChanKeySignerDecodeErrorZ() && { LDKCResult_ChanKeySignerDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChanKeySignerDecodeErrorZ)); return res; } - ~CResult_ChanKeySignerDecodeErrorZ() { CResult_ChanKeySignerDecodeErrorZ_free(self); } - CResult_ChanKeySignerDecodeErrorZ& operator=(CResult_ChanKeySignerDecodeErrorZ&& o) { CResult_ChanKeySignerDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChanKeySignerDecodeErrorZ)); return *this; } - LDKCResult_ChanKeySignerDecodeErrorZ* operator &() { return &self; } - LDKCResult_ChanKeySignerDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_ChanKeySignerDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_ChanKeySignerDecodeErrorZ* operator ->() const { return &self; } -}; class CVec_RouteHopZ { private: LDKCVec_RouteHopZ self; @@ -2381,20 +2366,20 @@ public: const LDKCVec_u8Z* operator &() const { return &self; } const LDKCVec_u8Z* operator ->() const { return &self; } }; -class CResult_PublicKeySecpErrorZ { +class CResult_PublicKeyErrorZ { private: - LDKCResult_PublicKeySecpErrorZ self; + LDKCResult_PublicKeyErrorZ self; public: - CResult_PublicKeySecpErrorZ(const CResult_PublicKeySecpErrorZ&) = delete; - CResult_PublicKeySecpErrorZ(CResult_PublicKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); } - CResult_PublicKeySecpErrorZ(LDKCResult_PublicKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); } - operator LDKCResult_PublicKeySecpErrorZ() && { LDKCResult_PublicKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); return res; } - ~CResult_PublicKeySecpErrorZ() { CResult_PublicKeySecpErrorZ_free(self); } - CResult_PublicKeySecpErrorZ& operator=(CResult_PublicKeySecpErrorZ&& o) { CResult_PublicKeySecpErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); return *this; } - LDKCResult_PublicKeySecpErrorZ* operator &() { return &self; } - LDKCResult_PublicKeySecpErrorZ* operator ->() { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator &() const { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator ->() const { return &self; } + CResult_PublicKeyErrorZ(const CResult_PublicKeyErrorZ&) = delete; + CResult_PublicKeyErrorZ(CResult_PublicKeyErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeyErrorZ)); } + CResult_PublicKeyErrorZ(LDKCResult_PublicKeyErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeyErrorZ)); } + operator LDKCResult_PublicKeyErrorZ() && { LDKCResult_PublicKeyErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeyErrorZ)); return res; } + ~CResult_PublicKeyErrorZ() { CResult_PublicKeyErrorZ_free(self); } + CResult_PublicKeyErrorZ& operator=(CResult_PublicKeyErrorZ&& o) { CResult_PublicKeyErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PublicKeyErrorZ)); return *this; } + LDKCResult_PublicKeyErrorZ* operator &() { return &self; } + LDKCResult_PublicKeyErrorZ* operator ->() { return &self; } + const LDKCResult_PublicKeyErrorZ* operator &() const { return &self; } + const LDKCResult_PublicKeyErrorZ* operator ->() const { return &self; } }; class CResult_RouteLightningErrorZ { private: @@ -2486,6 +2471,21 @@ public: const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator &() const { return &self; } const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator ->() const { return &self; } }; +class CResult_ChannelKeysDecodeErrorZ { +private: + LDKCResult_ChannelKeysDecodeErrorZ self; +public: + CResult_ChannelKeysDecodeErrorZ(const CResult_ChannelKeysDecodeErrorZ&) = delete; + CResult_ChannelKeysDecodeErrorZ(CResult_ChannelKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelKeysDecodeErrorZ)); } + CResult_ChannelKeysDecodeErrorZ(LDKCResult_ChannelKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelKeysDecodeErrorZ)); } + operator LDKCResult_ChannelKeysDecodeErrorZ() && { LDKCResult_ChannelKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelKeysDecodeErrorZ)); return res; } + ~CResult_ChannelKeysDecodeErrorZ() { CResult_ChannelKeysDecodeErrorZ_free(self); } + CResult_ChannelKeysDecodeErrorZ& operator=(CResult_ChannelKeysDecodeErrorZ&& o) { CResult_ChannelKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelKeysDecodeErrorZ)); return *this; } + LDKCResult_ChannelKeysDecodeErrorZ* operator &() { return &self; } + LDKCResult_ChannelKeysDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_ChannelKeysDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_ChannelKeysDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_InitDecodeErrorZ { private: LDKCResult_InitDecodeErrorZ self; @@ -2606,21 +2606,6 @@ public: const LDKC2Tuple_OutPointScriptZ* operator &() const { return &self; } const LDKC2Tuple_OutPointScriptZ* operator ->() const { return &self; } }; -class CResult_InMemoryChannelKeysDecodeErrorZ { -private: - LDKCResult_InMemoryChannelKeysDecodeErrorZ self; -public: - CResult_InMemoryChannelKeysDecodeErrorZ(const CResult_InMemoryChannelKeysDecodeErrorZ&) = delete; - CResult_InMemoryChannelKeysDecodeErrorZ(CResult_InMemoryChannelKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InMemoryChannelKeysDecodeErrorZ)); } - CResult_InMemoryChannelKeysDecodeErrorZ(LDKCResult_InMemoryChannelKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ)); } - operator LDKCResult_InMemoryChannelKeysDecodeErrorZ() && { LDKCResult_InMemoryChannelKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ)); return res; } - ~CResult_InMemoryChannelKeysDecodeErrorZ() { CResult_InMemoryChannelKeysDecodeErrorZ_free(self); } - CResult_InMemoryChannelKeysDecodeErrorZ& operator=(CResult_InMemoryChannelKeysDecodeErrorZ&& o) { CResult_InMemoryChannelKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InMemoryChannelKeysDecodeErrorZ)); return *this; } - LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() { return &self; } - LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() { return &self; } - const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() const { return &self; } - const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() const { return &self; } -}; class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { private: LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ self; @@ -2636,6 +2621,21 @@ public: const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; } const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; } }; +class CResult_InMemoryChannelKeysDecodeErrorZ { +private: + LDKCResult_InMemoryChannelKeysDecodeErrorZ self; +public: + CResult_InMemoryChannelKeysDecodeErrorZ(const CResult_InMemoryChannelKeysDecodeErrorZ&) = delete; + CResult_InMemoryChannelKeysDecodeErrorZ(CResult_InMemoryChannelKeysDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_InMemoryChannelKeysDecodeErrorZ)); } + CResult_InMemoryChannelKeysDecodeErrorZ(LDKCResult_InMemoryChannelKeysDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ)); } + operator LDKCResult_InMemoryChannelKeysDecodeErrorZ() && { LDKCResult_InMemoryChannelKeysDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_InMemoryChannelKeysDecodeErrorZ)); return res; } + ~CResult_InMemoryChannelKeysDecodeErrorZ() { CResult_InMemoryChannelKeysDecodeErrorZ_free(self); } + CResult_InMemoryChannelKeysDecodeErrorZ& operator=(CResult_InMemoryChannelKeysDecodeErrorZ&& o) { CResult_InMemoryChannelKeysDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_InMemoryChannelKeysDecodeErrorZ)); return *this; } + LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() { return &self; } + LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() { return &self; } + const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() const { return &self; } + const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() const { return &self; } +}; class CResult_RouteDecodeErrorZ { private: LDKCResult_RouteDecodeErrorZ self; diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 6f703a5b1..d2dda0a2e 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -1042,36 +1042,36 @@ impl Clone for CResult_SignatureNoneZ { #[no_mangle] pub extern "C" fn CResult_SignatureNoneZ_clone(orig: &CResult_SignatureNoneZ) -> CResult_SignatureNoneZ { orig.clone() } #[repr(C)] -pub union CResult_ChanKeySignerDecodeErrorZPtr { +pub union CResult_ChannelKeysDecodeErrorZPtr { pub result: *mut crate::chain::keysinterface::ChannelKeys, pub err: *mut crate::ln::msgs::DecodeError, } #[repr(C)] -pub struct CResult_ChanKeySignerDecodeErrorZ { - pub contents: CResult_ChanKeySignerDecodeErrorZPtr, +pub struct CResult_ChannelKeysDecodeErrorZ { + pub contents: CResult_ChannelKeysDecodeErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChanKeySignerDecodeErrorZ { - CResult_ChanKeySignerDecodeErrorZ { - contents: CResult_ChanKeySignerDecodeErrorZPtr { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_ok(o: crate::chain::keysinterface::ChannelKeys) -> CResult_ChannelKeysDecodeErrorZ { + CResult_ChannelKeysDecodeErrorZ { + contents: CResult_ChannelKeysDecodeErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChanKeySignerDecodeErrorZ { - CResult_ChanKeySignerDecodeErrorZ { - contents: CResult_ChanKeySignerDecodeErrorZPtr { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_err(e: crate::ln::msgs::DecodeError) -> CResult_ChannelKeysDecodeErrorZ { + CResult_ChannelKeysDecodeErrorZ { + contents: CResult_ChannelKeysDecodeErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_free(_res: CResult_ChanKeySignerDecodeErrorZ) { } -impl Drop for CResult_ChanKeySignerDecodeErrorZ { +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_free(_res: CResult_ChannelKeysDecodeErrorZ) { } +impl Drop for CResult_ChannelKeysDecodeErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -1084,16 +1084,16 @@ impl Drop for CResult_ChanKeySignerDecodeErrorZ { } } } -impl From> for CResult_ChanKeySignerDecodeErrorZ { +impl From> for CResult_ChannelKeysDecodeErrorZ { fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_ChanKeySignerDecodeErrorZPtr { result } + CResult_ChannelKeysDecodeErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_ChanKeySignerDecodeErrorZPtr { err } + CResult_ChannelKeysDecodeErrorZPtr { err } }; Self { contents, @@ -1101,21 +1101,21 @@ impl From Self { if self.result_ok { - Self { result_ok: true, contents: CResult_ChanKeySignerDecodeErrorZPtr { + Self { result_ok: true, contents: CResult_ChannelKeysDecodeErrorZPtr { result: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.result }))) } } } else { - Self { result_ok: false, contents: CResult_ChanKeySignerDecodeErrorZPtr { + Self { result_ok: false, contents: CResult_ChannelKeysDecodeErrorZPtr { err: Box::into_raw(Box::new(::clone(unsafe { &*self.contents.err }))) } } } } } #[no_mangle] -pub extern "C" fn CResult_ChanKeySignerDecodeErrorZ_clone(orig: &CResult_ChanKeySignerDecodeErrorZ) -> CResult_ChanKeySignerDecodeErrorZ { orig.clone() } +pub extern "C" fn CResult_ChannelKeysDecodeErrorZ_clone(orig: &CResult_ChannelKeysDecodeErrorZ) -> CResult_ChannelKeysDecodeErrorZ { orig.clone() } #[repr(C)] pub union CResult_InMemoryChannelKeysDecodeErrorZPtr { pub result: *mut crate::chain::keysinterface::InMemoryChannelKeys, @@ -3496,36 +3496,36 @@ impl Clone for CResult_boolPeerHandleErrorZ { #[no_mangle] pub extern "C" fn CResult_boolPeerHandleErrorZ_clone(orig: &CResult_boolPeerHandleErrorZ) -> CResult_boolPeerHandleErrorZ { orig.clone() } #[repr(C)] -pub union CResult_SecretKeySecpErrorZPtr { +pub union CResult_SecretKeyErrorZPtr { pub result: *mut crate::c_types::SecretKey, pub err: *mut crate::c_types::Secp256k1Error, } #[repr(C)] -pub struct CResult_SecretKeySecpErrorZ { - pub contents: CResult_SecretKeySecpErrorZPtr, +pub struct CResult_SecretKeyErrorZ { + pub contents: CResult_SecretKeyErrorZPtr, pub result_ok: bool, } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_ok(o: crate::c_types::SecretKey) -> CResult_SecretKeySecpErrorZ { - CResult_SecretKeySecpErrorZ { - contents: CResult_SecretKeySecpErrorZPtr { +pub extern "C" fn CResult_SecretKeyErrorZ_ok(o: crate::c_types::SecretKey) -> CResult_SecretKeyErrorZ { + CResult_SecretKeyErrorZ { + contents: CResult_SecretKeyErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_SecretKeySecpErrorZ { - CResult_SecretKeySecpErrorZ { - contents: CResult_SecretKeySecpErrorZPtr { +pub extern "C" fn CResult_SecretKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_SecretKeyErrorZ { + CResult_SecretKeyErrorZ { + contents: CResult_SecretKeyErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_SecretKeySecpErrorZ_free(_res: CResult_SecretKeySecpErrorZ) { } -impl Drop for CResult_SecretKeySecpErrorZ { +pub extern "C" fn CResult_SecretKeyErrorZ_free(_res: CResult_SecretKeyErrorZ) { } +impl Drop for CResult_SecretKeyErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3538,16 +3538,16 @@ impl Drop for CResult_SecretKeySecpErrorZ { } } } -impl From> for CResult_SecretKeySecpErrorZ { +impl From> for CResult_SecretKeyErrorZ { fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_SecretKeySecpErrorZPtr { result } + CResult_SecretKeyErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_SecretKeySecpErrorZPtr { err } + CResult_SecretKeyErrorZPtr { err } }; Self { contents, @@ -3556,36 +3556,36 @@ impl From CResult_PublicKeySecpErrorZ { - CResult_PublicKeySecpErrorZ { - contents: CResult_PublicKeySecpErrorZPtr { +pub extern "C" fn CResult_PublicKeyErrorZ_ok(o: crate::c_types::PublicKey) -> CResult_PublicKeyErrorZ { + CResult_PublicKeyErrorZ { + contents: CResult_PublicKeyErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_PublicKeySecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_PublicKeySecpErrorZ { - CResult_PublicKeySecpErrorZ { - contents: CResult_PublicKeySecpErrorZPtr { +pub extern "C" fn CResult_PublicKeyErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_PublicKeyErrorZ { + CResult_PublicKeyErrorZ { + contents: CResult_PublicKeyErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_PublicKeySecpErrorZ_free(_res: CResult_PublicKeySecpErrorZ) { } -impl Drop for CResult_PublicKeySecpErrorZ { +pub extern "C" fn CResult_PublicKeyErrorZ_free(_res: CResult_PublicKeyErrorZ) { } +impl Drop for CResult_PublicKeyErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3598,16 +3598,16 @@ impl Drop for CResult_PublicKeySecpErrorZ { } } } -impl From> for CResult_PublicKeySecpErrorZ { +impl From> for CResult_PublicKeyErrorZ { fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_PublicKeySecpErrorZPtr { result } + CResult_PublicKeyErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_PublicKeySecpErrorZPtr { err } + CResult_PublicKeyErrorZPtr { err } }; Self { contents, @@ -3616,36 +3616,36 @@ impl From CResult_TxCreationKeysSecpErrorZ { - CResult_TxCreationKeysSecpErrorZ { - contents: CResult_TxCreationKeysSecpErrorZPtr { +pub extern "C" fn CResult_TxCreationKeysErrorZ_ok(o: crate::ln::chan_utils::TxCreationKeys) -> CResult_TxCreationKeysErrorZ { + CResult_TxCreationKeysErrorZ { + contents: CResult_TxCreationKeysErrorZPtr { result: Box::into_raw(Box::new(o)), }, result_ok: true, } } #[no_mangle] -pub extern "C" fn CResult_TxCreationKeysSecpErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_TxCreationKeysSecpErrorZ { - CResult_TxCreationKeysSecpErrorZ { - contents: CResult_TxCreationKeysSecpErrorZPtr { +pub extern "C" fn CResult_TxCreationKeysErrorZ_err(e: crate::c_types::Secp256k1Error) -> CResult_TxCreationKeysErrorZ { + CResult_TxCreationKeysErrorZ { + contents: CResult_TxCreationKeysErrorZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] -pub extern "C" fn CResult_TxCreationKeysSecpErrorZ_free(_res: CResult_TxCreationKeysSecpErrorZ) { } -impl Drop for CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn CResult_TxCreationKeysErrorZ_free(_res: CResult_TxCreationKeysErrorZ) { } +impl Drop for CResult_TxCreationKeysErrorZ { fn drop(&mut self) { if self.result_ok { if unsafe { !(self.contents.result as *mut ()).is_null() } { @@ -3658,16 +3658,16 @@ impl Drop for CResult_TxCreationKeysSecpErrorZ { } } } -impl From> for CResult_TxCreationKeysSecpErrorZ { +impl From> for CResult_TxCreationKeysErrorZ { fn from(mut o: crate::c_types::CResultTempl) -> Self { let contents = if o.result_ok { let result = unsafe { o.contents.result }; unsafe { o.contents.result = std::ptr::null_mut() }; - CResult_TxCreationKeysSecpErrorZPtr { result } + CResult_TxCreationKeysErrorZPtr { result } } else { let err = unsafe { o.contents.err }; unsafe { o.contents.err = std::ptr::null_mut(); } - CResult_TxCreationKeysSecpErrorZPtr { err } + CResult_TxCreationKeysErrorZPtr { err } }; Self { contents, diff --git a/lightning-c-bindings/src/chain/keysinterface.rs b/lightning-c-bindings/src/chain/keysinterface.rs index cef2cdd4d..fafa54228 100644 --- a/lightning-c-bindings/src/chain/keysinterface.rs +++ b/lightning-c-bindings/src/chain/keysinterface.rs @@ -513,7 +513,7 @@ pub struct KeysInterface { /// contain no versioning scheme. You may wish to include your own version prefix and ensure /// you've read all of the provided bytes to ensure no corruption occurred. #[must_use] - pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChanKeySignerDecodeErrorZ, + pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelKeysDecodeErrorZ, pub free: Option, } unsafe impl Send for KeysInterface {} @@ -1010,7 +1010,7 @@ extern "C" fn KeysManager_KeysInterface_get_secure_random_bytes(this_arg: *const crate::c_types::ThirtyTwoBytes { data: ret } } #[must_use] -extern "C" fn KeysManager_KeysInterface_read_chan_signer(this_arg: *const c_void, mut reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChanKeySignerDecodeErrorZ { +extern "C" fn KeysManager_KeysInterface_read_chan_signer(this_arg: *const c_void, mut reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelKeysDecodeErrorZ { let mut ret = unsafe { &mut *(this_arg as *mut nativeKeysManager) }.read_chan_signer(reader.to_slice()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { o.into() }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() }; local_ret diff --git a/lightning-c-bindings/src/ln/chan_utils.rs b/lightning-c-bindings/src/ln/chan_utils.rs index df66c9176..52f6d3686 100644 --- a/lightning-c-bindings/src/ln/chan_utils.rs +++ b/lightning-c-bindings/src/ln/chan_utils.rs @@ -19,7 +19,7 @@ pub extern "C" fn build_commitment_secret(commitment_seed: *const [u8; 32], mut /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::PublicKey, base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { +pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::PublicKey, base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_private_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *base_secret}[..]).unwrap()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::SecretKey::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -32,7 +32,7 @@ pub extern "C" fn derive_private_key(mut per_commitment_point: crate::c_types::P /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::PublicKey, mut base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { +pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::PublicKey, mut base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_public_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &base_point.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::PublicKey::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -48,7 +48,7 @@ pub extern "C" fn derive_public_key(mut per_commitment_point: crate::c_types::Pu /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], countersignatory_revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { +pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], countersignatory_revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_private_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *per_commitment_secret}[..]).unwrap(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *countersignatory_revocation_base_secret}[..]).unwrap()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::SecretKey::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -66,7 +66,7 @@ pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_public_revocation_key(mut per_commitment_point: crate::c_types::PublicKey, mut countersignatory_revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { +pub extern "C" fn derive_public_revocation_key(mut per_commitment_point: crate::c_types::PublicKey, mut countersignatory_revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeyErrorZ { let mut ret = lightning::ln::chan_utils::derive_public_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &countersignatory_revocation_base_point.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::PublicKey::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -384,7 +384,7 @@ pub extern "C" fn ChannelPublicKeys_read(ser: crate::c_types::u8slice) -> Channe /// Key set is asymmetric and can't be used as part of counter-signatory set of transactions. #[must_use] #[no_mangle] -pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_types::PublicKey, mut broadcaster_delayed_payment_base: crate::c_types::PublicKey, mut broadcaster_htlc_base: crate::c_types::PublicKey, mut countersignatory_revocation_base: crate::c_types::PublicKey, mut countersignatory_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_types::PublicKey, mut broadcaster_delayed_payment_base: crate::c_types::PublicKey, mut broadcaster_htlc_base: crate::c_types::PublicKey, mut countersignatory_revocation_base: crate::c_types::PublicKey, mut countersignatory_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysErrorZ { let mut ret = lightning::ln::chan_utils::TxCreationKeys::derive_new(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &broadcaster_delayed_payment_base.into_rust(), &broadcaster_htlc_base.into_rust(), &countersignatory_revocation_base.into_rust(), &countersignatory_htlc_base.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret @@ -394,7 +394,7 @@ pub extern "C" fn TxCreationKeys_derive_new(mut per_commitment_point: crate::c_t /// Key set is asymmetric and can't be used as part of counter-signatory set of transactions. #[must_use] #[no_mangle] -pub extern "C" fn TxCreationKeys_from_channel_static_keys(mut per_commitment_point: crate::c_types::PublicKey, broadcaster_keys: &crate::ln::chan_utils::ChannelPublicKeys, countersignatory_keys: &crate::ln::chan_utils::ChannelPublicKeys) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { +pub extern "C" fn TxCreationKeys_from_channel_static_keys(mut per_commitment_point: crate::c_types::PublicKey, broadcaster_keys: &crate::ln::chan_utils::ChannelPublicKeys, countersignatory_keys: &crate::ln::chan_utils::ChannelPublicKeys) -> crate::c_types::derived::CResult_TxCreationKeysErrorZ { let mut ret = lightning::ln::chan_utils::TxCreationKeys::from_channel_static_keys(&per_commitment_point.into_rust(), unsafe { &*broadcaster_keys.inner }, unsafe { &*countersignatory_keys.inner }, &bitcoin::secp256k1::Secp256k1::new()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }).into() }; local_ret