Skip to content

Expand documentation and fields in SpendableOutputDescriptors #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fuzz/src/chanmon_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl KeysInterface for KeyProvider {
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, self.node_id]).unwrap(),
[id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, self.node_id],
channel_value_satoshis,
(0, 0),
[0; 32],
);
let revoked_commitment = self.make_revoked_commitment_cell(keys.commitment_seed);
EnforcingChannelKeys::new_with_revoked(keys, revoked_commitment, false)
Expand Down
4 changes: 2 additions & 2 deletions fuzz/src/full_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl KeysInterface for KeyProvider {
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, ctr]).unwrap(),
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, ctr],
channel_value_satoshis,
(0, 0),
[0; 32]
)
} else {
InMemoryChannelKeys::new(
Expand All @@ -291,7 +291,7 @@ impl KeysInterface for KeyProvider {
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, ctr]).unwrap(),
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, ctr],
channel_value_satoshis,
(0, 0),
[0; 32]
)
})
}
Expand Down
15 changes: 7 additions & 8 deletions lightning-c-bindings/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ const uint8_t channel_open_tx[] = {
0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x40, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x20, 0x12, 0x70, 0x44,
0x41, 0x40, 0xaf, 0xc5, 0x72, 0x97, 0xc8, 0x69, 0xba, 0x04, 0xdb, 0x28, 0x7b, 0xd7, 0x32, 0x07,
0x33, 0x3a, 0x4a, 0xc2, 0xc5, 0x56, 0x06, 0x05, 0x65, 0xd7, 0xa8, 0xcf, 0x01, 0x00, 0x00, 0x00,
0x01, 0x40, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0xd1, 0xd9, 0x13, 0xa9,
Copy link
Contributor

@valentinewallace valentinewallace Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops post-merge review but, I don't get why this PR's changes would result in a different channel-opening tx being necessary in the demo?

0x76, 0x09, 0x05, 0xa3, 0x4d, 0x13, 0x5b, 0x69, 0xaa, 0xe7, 0x79, 0x71, 0xb9, 0x75, 0xa1, 0xd0,
0x77, 0xcb, 0xa2, 0xf6, 0x6a, 0x25, 0x37, 0x3a, 0xaf, 0xdc, 0x11, 0x09, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00
};

// The first transaction in the block is header (80 bytes) + transaction count (1 byte) into the block data.
const uint8_t channel_open_txid[] = {
0x5f, 0xa9, 0x4c, 0xee, 0x7d, 0x4f, 0x4c, 0x75, 0xbb, 0xb8, 0x98, 0xcf, 0xce, 0x5a, 0x84, 0x63,
0xde, 0x96, 0xa9, 0xbb, 0x34, 0x9a, 0x7a, 0xf9, 0x3f, 0x6a, 0xe0, 0xd4, 0xf8, 0xd2, 0x47, 0xa2
0x02, 0xe0, 0x50, 0x05, 0x33, 0xd3, 0x29, 0x66, 0x0c, 0xb2, 0xcb, 0x1e, 0x7a, 0x4a, 0xc7, 0xc7,
0x8b, 0x02, 0x46, 0x7e, 0x30, 0x2c, 0xe6, 0x19, 0xce, 0x43, 0x3e, 0xdf, 0x43, 0x65, 0xae, 0xf9,
};

// Two blocks built on top of channel_open_block:
Expand Down Expand Up @@ -631,8 +631,7 @@ int main() {
// Few extra random tests:
LDKSecretKey sk;
memset(&sk, 42, 32);
LDKC2Tuple_u64u64Z kdiv_params;
kdiv_params.a = 42;
kdiv_params.b = 42;
LDKThirtyTwoBytes kdiv_params;
memset(&kdiv_params, 43, 32);
LDK::InMemoryChannelKeys keys = InMemoryChannelKeys_new(sk, sk, sk, sk, sk, random_bytes, 42, kdiv_params);
}
68 changes: 36 additions & 32 deletions lightning-c-bindings/include/lightning.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,13 @@ typedef struct LDKPublicKey {
uint8_t compressed_form[33];
} LDKPublicKey;

typedef struct LDKC2Tuple_u64u64Z {
uint64_t a;
uint64_t b;
} LDKC2Tuple_u64u64Z;
/**
* Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
* look up the corresponding function in rust-lightning's docs.
*/
typedef struct LDKThirtyTwoBytes {
uint8_t data[32];
} LDKThirtyTwoBytes;

/**
* When on-chain outputs are created by rust-lightning (which our counterparty is not able to
Expand All @@ -255,9 +258,9 @@ typedef struct LDKC2Tuple_u64u64Z {
*/
typedef enum LDKSpendableOutputDescriptor_Tag {
/**
* An output to a script which was provided via KeysInterface, thus you should already know
* how to spend it. No keys are provided as rust-lightning was never given any keys - only the
* script_pubkey as it appears in the output.
* An output to a script which was provided via KeysInterface directly, either from
* `get_destination_script()` or `get_shutdown_pubkey()`, 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.
*/
Expand Down Expand Up @@ -319,14 +322,16 @@ typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body {
struct LDKPublicKey per_commitment_point;
uint16_t to_self_delay;
struct LDKTxOut output;
struct LDKC2Tuple_u64u64Z key_derivation_params;
struct LDKPublicKey revocation_pubkey;
struct LDKThirtyTwoBytes channel_keys_id;
uint64_t channel_value_satoshis;
} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body;

typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body {
struct LDKOutPoint outpoint;
struct LDKTxOut output;
struct LDKC2Tuple_u64u64Z key_derivation_params;
struct LDKThirtyTwoBytes channel_keys_id;
uint64_t channel_value_satoshis;
} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body;

typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
Expand Down Expand Up @@ -889,14 +894,6 @@ typedef struct LDKCVec_MessageSendEventZ {
uintptr_t datalen;
} LDKCVec_MessageSendEventZ;

/**
* Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
* look up the corresponding function in rust-lightning's docs.
*/
typedef struct LDKThirtyTwoBytes {
uint8_t data[32];
} LDKThirtyTwoBytes;

/**
* An Event which you should probably take some action in response to.
*
Expand Down Expand Up @@ -1349,11 +1346,11 @@ typedef struct LDKChannelKeys {
*/
void (*set_pubkeys)(const struct LDKChannelKeys*NONNULL_PTR );
/**
* Gets arbitrary identifiers describing the set of keys which are provided back to you in
* some SpendableOutputDescriptor types. These should be sufficient to identify this
* Gets an arbitrary identifier describing the set of keys which are provided back to you in
* some SpendableOutputDescriptor types. This should be sufficient to identify this
* ChannelKeys object uniquely and lookup or re-derive its keys.
*/
struct LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg);
struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
/**
* Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
*
Expand Down Expand Up @@ -1849,26 +1846,39 @@ typedef struct LDKu8slice {
typedef struct LDKKeysInterface {
void *this_arg;
/**
* Get node secret key (aka node_id or network_key)
* Get node secret key (aka node_id or network_key).
*
* This method must return the same value each time it is called.
*/
struct LDKSecretKey (*get_node_secret)(const void *this_arg);
/**
* Get destination redeemScript to encumber static protocol exit points.
* Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
*
* This method should return a different value each time it is called, to avoid linking
* on-chain funds across channels as controlled to the same user.
*/
struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
/**
* Get shutdown_pubkey to use as PublicKey at channel closure
* Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
* a channel.
*
* This method should return a different value each time it is called, to avoid linking
* on-chain funds across channels as controlled to the same user.
*/
struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
/**
* Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
* restarted with some stale data!
*
* This method must return a different value each time it is called.
*/
struct LDKChannelKeys (*get_channel_keys)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
/**
* Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
* onion packets and for temporary channel IDs. There is no requirement that these be
* persisted anywhere, though they must be unique across restarts.
*
* This method must return a different value each time it is called.
*/
struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
/**
Expand Down Expand Up @@ -3548,12 +3558,6 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_B

void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);

struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);

struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);

void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);

struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);

struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
Expand Down Expand Up @@ -4686,7 +4690,7 @@ void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONN
/**
* Create a new InMemoryChannelKeys
*/
MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_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 LDKC2Tuple_u64u64Z key_derivation_params);
MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_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);

/**
* Counterparty pubkeys.
Expand Down Expand Up @@ -4765,10 +4769,10 @@ MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], en
* Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
* parameters.
* Key derivation parameters are accessible through a per-channel secrets
* ChannelKeys::key_derivation_params and is provided inside DynamicOuputP2WSH in case of
* ChannelKeys::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
* onchain output detection for which a corresponding delayed_payment_key must be derived.
*/
MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2);
MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]);

struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);

Expand Down
63 changes: 24 additions & 39 deletions lightning-c-bindings/include/lightningpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2096,21 +2096,6 @@ class CVec_PublicKeyZ {
const LDKCVec_PublicKeyZ* operator &() const { return &self; }
const LDKCVec_PublicKeyZ* operator ->() const { return &self; }
};
class C2Tuple_u64u64Z {
private:
LDKC2Tuple_u64u64Z self;
public:
C2Tuple_u64u64Z(const C2Tuple_u64u64Z&) = delete;
C2Tuple_u64u64Z(C2Tuple_u64u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_u64u64Z)); }
C2Tuple_u64u64Z(LDKC2Tuple_u64u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_u64u64Z)); }
operator LDKC2Tuple_u64u64Z() && { LDKC2Tuple_u64u64Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_u64u64Z)); return res; }
~C2Tuple_u64u64Z() { C2Tuple_u64u64Z_free(self); }
C2Tuple_u64u64Z& operator=(C2Tuple_u64u64Z&& o) { C2Tuple_u64u64Z_free(self); self = o.self; memset(&o, 0, sizeof(C2Tuple_u64u64Z)); return *this; }
LDKC2Tuple_u64u64Z* operator &() { return &self; }
LDKC2Tuple_u64u64Z* operator ->() { return &self; }
const LDKC2Tuple_u64u64Z* operator &() const { return &self; }
const LDKC2Tuple_u64u64Z* operator ->() const { return &self; }
};
class C2Tuple_u32TxOutZ {
private:
LDKC2Tuple_u32TxOutZ self;
Expand Down Expand Up @@ -2576,20 +2561,20 @@ class CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator &() const { return &self; }
const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator ->() const { return &self; }
};
class CVec_UpdateFailHTLCZ {
class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
private:
LDKCVec_UpdateFailHTLCZ self;
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ self;
public:
CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete;
CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); }
CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); }
operator LDKCVec_UpdateFailHTLCZ() && { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; }
~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); }
CVec_UpdateFailHTLCZ& operator=(CVec_UpdateFailHTLCZ&& o) { CVec_UpdateFailHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); return *this; }
LDKCVec_UpdateFailHTLCZ* operator &() { return &self; }
LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; }
const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; }
const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(const CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&) = delete;
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
operator LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() && { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return res; }
~CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ& operator=(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return *this; }
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() { return &self; }
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() { return &self; }
const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; }
};
class C2Tuple_OutPointScriptZ {
private:
Expand Down Expand Up @@ -2621,20 +2606,20 @@ class CResult_InMemoryChannelKeysDecodeErrorZ {
const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_InMemoryChannelKeysDecodeErrorZ* operator ->() const { return &self; }
};
class CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
class CVec_UpdateFailHTLCZ {
private:
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ self;
LDKCVec_UpdateFailHTLCZ self;
public:
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(const CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&) = delete;
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); }
operator LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() && { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return res; }
~CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ() { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); }
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ& operator=(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ&& o) { CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ)); return *this; }
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() { return &self; }
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() { return &self; }
const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator &() const { return &self; }
const LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* operator ->() const { return &self; }
CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete;
CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); }
CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); }
operator LDKCVec_UpdateFailHTLCZ() && { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; }
~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); }
CVec_UpdateFailHTLCZ& operator=(CVec_UpdateFailHTLCZ&& o) { CVec_UpdateFailHTLCZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); return *this; }
LDKCVec_UpdateFailHTLCZ* operator &() { return &self; }
LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; }
const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; }
const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; }
};
class CResult_RouteDecodeErrorZ {
private:
Expand Down
35 changes: 0 additions & 35 deletions lightning-c-bindings/src/c_types/derived.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,41 +711,6 @@ impl From<crate::c_types::CResultTempl<crate::c_types::derived::C2Tuple_BlockHas
}
}
#[repr(C)]
pub struct C2Tuple_u64u64Z {
pub a: u64,
pub b: u64,
}
impl From<(u64, u64)> for C2Tuple_u64u64Z {
fn from (tup: (u64, u64)) -> Self {
Self {
a: tup.0,
b: tup.1,
}
}
}
impl C2Tuple_u64u64Z {
#[allow(unused)] pub(crate) fn to_rust(mut self) -> (u64, u64) {
(self.a, self.b)
}
}
impl Clone for C2Tuple_u64u64Z {
fn clone(&self) -> Self {
Self {
a: self.a.clone(),
b: self.b.clone(),
}
}
}
#[no_mangle]
pub extern "C" fn C2Tuple_u64u64Z_clone(orig: &C2Tuple_u64u64Z) -> C2Tuple_u64u64Z { orig.clone() }
#[no_mangle]
pub extern "C" fn C2Tuple_u64u64Z_new(a: u64, b: u64) -> C2Tuple_u64u64Z {
C2Tuple_u64u64Z { a, b, }
}

#[no_mangle]
pub extern "C" fn C2Tuple_u64u64Z_free(_res: C2Tuple_u64u64Z) { }
#[repr(C)]
pub union CResult_SpendableOutputDescriptorDecodeErrorZPtr {
pub result: *mut crate::chain::keysinterface::SpendableOutputDescriptor,
pub err: *mut crate::ln::msgs::DecodeError,
Expand Down
Loading