Skip to content

Commit 999dff8

Browse files
committed
Prepare version 0.0.112
1 parent bfac342 commit 999dff8

File tree

95 files changed

+5409
-4040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5409
-4040
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ runs:
2222
run: |
2323
echo `pwd`
2424
mkdir -p ${{ inputs.destination }}/bin
25-
git clone --branch 2022-09-111-java-bindings https://github.com/TheBlueMatt/rust-lightning ${{ inputs.destination }}/rust-lightning
26-
git clone --branch v0.0.111.0 https://github.com/lightningdevkit/ldk-c-bindings ${{ inputs.destination }}/ldk-c-bindings
25+
git clone --branch 2022-10-112-java-bindings https://github.com/TheBlueMatt/rust-lightning ${{ inputs.destination }}/rust-lightning
26+
git clone --branch v0.0.112.0 https://github.com/lightningdevkit/ldk-c-bindings ${{ inputs.destination }}/ldk-c-bindings
2727
- name: Install Rust, required targets
2828
if: ${{ inputs.configureRustNightly == 'true' }}
2929
shell: bash

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ In order to generate these bindings from scratch, you will need to clone two dep
3636
**[rust-lightning](https://github.com/lightningdevkit/rust-lightning)**, (a specific branch built for bindings compatibility):
3737

3838
```shell
39-
git clone --branch 2022-09-111-java-bindings https://github.com/TheBlueMatt/rust-lightning /path/to/rust-lightning
39+
git clone --branch 2022-10-112-java-bindings https://github.com/TheBlueMatt/rust-lightning /path/to/rust-lightning
4040
```
4141

4242
**[ldk-c-bindings](https://github.com/lightningdevkit/ldk-c-bindings)**:
4343

4444
```shell
45-
git clone --branch v0.0.111.0 https://github.com/lightningdevkit/ldk-c-bindings /path/to/ldk-c-bindings
45+
git clone --branch v0.0.112.0 https://github.com/lightningdevkit/ldk-c-bindings /path/to/ldk-c-bindings
4646
```
4747

4848
Take note of where you clone these directories, it's best you save the absolute path somewhere handy for the rest of the remaining steps.

ci/LDKSwift/Sources/LDKSwift/batteries/ChannelManagerConstructor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
133133
guard let nodeSecret = keys_interface.get_node_secret(recipient: LDKRecipient_Node).getValue() else {
134134
throw InvalidSerializedDataError.badNodeSecret
135135
}
136-
let timestampSeconds = UInt64(NSDate().timeIntervalSince1970)
136+
let timestampSeconds = UInt32(NSDate().timeIntervalSince1970)
137137
self.peerManager = PeerManager(message_handler: messageHandler.dangle(), our_node_secret: nodeSecret, current_time: timestampSeconds, ephemeral_random_data: random_data, logger: self.logger, custom_message_handler: IgnoringMessageHandler().as_CustomMessageHandler())
138138

139139
if let filter = filter {
@@ -178,7 +178,7 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
178178
messageHandler = MessageHandler(chan_handler_arg: channelManager.as_ChannelMessageHandler(), route_handler_arg: noCustomMessages.as_RoutingMessageHandler(), onion_message_handler_arg: noCustomMessages.as_OnionMessageHandler())
179179
}
180180
let nodeSecret = keys_interface.get_node_secret(recipient: LDKRecipient_Node).getValue()!
181-
let timestampSeconds = UInt64(NSDate().timeIntervalSince1970)
181+
let timestampSeconds = UInt32(NSDate().timeIntervalSince1970)
182182
self.peerManager = PeerManager(message_handler: messageHandler.dangle(), our_node_secret: nodeSecret, current_time: timestampSeconds, ephemeral_random_data: random_data, logger: logger, custom_message_handler: noCustomMessages.as_CustomMessageHandler())
183183

184184

@@ -213,8 +213,8 @@ public class ChannelManagerConstructor: NativeTypeWrapper {
213213
let outPoint = OutPoint(pointer: fundingTxo.cOpaqueStruct!.a).dangle()
214214
print("watching channel")
215215
let monitorWatchResult = chainMonitorWatch.watch_channel(funding_txo: outPoint, monitor: monitorClone)
216-
if !monitorWatchResult.isOk() {
217-
print("Some error occurred with a chainMonitorWatch.watch_channel call")
216+
if monitorWatchResult != LDKChannelMonitorUpdateStatus_Completed {
217+
print("Some error occurred with a chainMonitorWatch.watch_channel call: \(monitorWatchResult)")
218218
}
219219
monitorClone.cOpaqueStruct?.is_owned = true
220220
}

ci/LDKSwift/Sources/LDKSwift/bindings/Bindings.swift

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5245,16 +5245,6 @@ public class Bindings {
52455245

52465246
CResult_TxOutAccessErrorZ_is_ok(oPointer)
52475247

5248-
}
5249-
5250-
}
5251-
public class func swift_CResult_NoneChannelMonitorUpdateErrZ_is_ok(o: Result_NoneChannelMonitorUpdateErrZ) -> Bool {
5252-
5253-
5254-
return withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKCResult_NoneChannelMonitorUpdateErrZ>) in
5255-
5256-
CResult_NoneChannelMonitorUpdateErrZ_is_ok(oPointer)
5257-
52585248
}
52595249

52605250
}
@@ -5505,6 +5495,16 @@ public class Bindings {
55055495

55065496
CResult_SecretKeyNoneZ_is_ok(oPointer)
55075497

5498+
}
5499+
5500+
}
5501+
public class func swift_CResult_PublicKeyNoneZ_is_ok(o: Result_PublicKeyNoneZ) -> Bool {
5502+
5503+
5504+
return withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKCResult_PublicKeyNoneZ>) in
5505+
5506+
CResult_PublicKeyNoneZ_is_ok(oPointer)
5507+
55085508
}
55095509

55105510
}
@@ -5915,6 +5915,16 @@ public class Bindings {
59155915

59165916
CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(oPointer)
59175917

5918+
}
5919+
5920+
}
5921+
public class func swift_CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o: Result_COption_CustomOnionMessageContentsZDecodeErrorZ) -> Bool {
5922+
5923+
5924+
return withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ>) in
5925+
5926+
CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(oPointer)
5927+
59185928
}
59195929

59205930
}
@@ -6411,6 +6421,30 @@ public class Bindings {
64116421

64126422
}
64136423

6424+
}
6425+
public class func swift_provided_node_features() -> NodeFeatures {
6426+
6427+
6428+
return
6429+
NodeFeatures(pointer: provided_node_features())
6430+
6431+
6432+
}
6433+
public class func swift_provided_channel_features() -> ChannelFeatures {
6434+
6435+
6436+
return
6437+
ChannelFeatures(pointer: provided_channel_features())
6438+
6439+
6440+
}
6441+
public class func swift_provided_init_features() -> InitFeatures {
6442+
6443+
6444+
return
6445+
InitFeatures(pointer: provided_init_features())
6446+
6447+
64146448
}
64156449
#warning("This method passes non-cloneable objects by owned value. Here be dragons.")
64166450
@available(*, deprecated, message: "This method passes non-cloneable objects by owned value. Here be dragons.")
@@ -6634,7 +6668,7 @@ withUnsafePointer(to: Bindings.array_to_tuple32(array: random_seed_bytes)) { (ra
66346668
}
66356669

66366670
}
6637-
public class func swift_create_phantom_invoice(amt_msat: Option_u64Z, payment_hash: [UInt8], description: String, invoice_expiry_delta_secs: UInt32, phantom_route_hints: [PhantomRouteHints], keys_manager: KeysInterface, network: LDKCurrency) -> Result_InvoiceSignOrCreationErrorZ {
6671+
public class func swift_create_phantom_invoice(amt_msat: Option_u64Z, payment_hash: [UInt8], description: String, invoice_expiry_delta_secs: UInt32, phantom_route_hints: [PhantomRouteHints], keys_manager: KeysInterface, logger: Logger, network: LDKCurrency) -> Result_InvoiceSignOrCreationErrorZ {
66386672

66396673

66406674
let phantom_route_hintsUnwrapped = phantom_route_hints.map { (phantom_route_hintsCurrentValue) in
@@ -6648,11 +6682,11 @@ withUnsafePointer(to: Bindings.array_to_tuple32(array: random_seed_bytes)) { (ra
66486682
}
66496683

66506684
return
6651-
Result_InvoiceSignOrCreationErrorZ(pointer: create_phantom_invoice(amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKThirtyTwoBytes(array: payment_hash), Bindings.new_LDKStr(string: description, chars_is_owned: true), invoice_expiry_delta_secs, phantom_route_hintsWrapper.dangle().cOpaqueStruct!, keys_manager.activate().cOpaqueStruct!, network))
6685+
Result_InvoiceSignOrCreationErrorZ(pointer: create_phantom_invoice(amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKThirtyTwoBytes(array: payment_hash), Bindings.new_LDKStr(string: description, chars_is_owned: true), invoice_expiry_delta_secs, phantom_route_hintsWrapper.dangle().cOpaqueStruct!, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network))
66526686

66536687

66546688
}
6655-
public class func swift_create_phantom_invoice_with_description_hash(amt_msat: Option_u64Z, payment_hash: [UInt8], invoice_expiry_delta_secs: UInt32, description_hash: Sha256, phantom_route_hints: [PhantomRouteHints], keys_manager: KeysInterface, network: LDKCurrency) -> Result_InvoiceSignOrCreationErrorZ {
6689+
public class func swift_create_phantom_invoice_with_description_hash(amt_msat: Option_u64Z, payment_hash: [UInt8], invoice_expiry_delta_secs: UInt32, description_hash: Sha256, phantom_route_hints: [PhantomRouteHints], keys_manager: KeysInterface, logger: Logger, network: LDKCurrency) -> Result_InvoiceSignOrCreationErrorZ {
66566690

66576691

66586692
let phantom_route_hintsUnwrapped = phantom_route_hints.map { (phantom_route_hintsCurrentValue) in
@@ -6666,46 +6700,46 @@ withUnsafePointer(to: Bindings.array_to_tuple32(array: random_seed_bytes)) { (ra
66666700
}
66676701

66686702
return
6669-
Result_InvoiceSignOrCreationErrorZ(pointer: create_phantom_invoice_with_description_hash(amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKThirtyTwoBytes(array: payment_hash), invoice_expiry_delta_secs, description_hash.danglingClone().cOpaqueStruct!, phantom_route_hintsWrapper.dangle().cOpaqueStruct!, keys_manager.activate().cOpaqueStruct!, network))
6703+
Result_InvoiceSignOrCreationErrorZ(pointer: create_phantom_invoice_with_description_hash(amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKThirtyTwoBytes(array: payment_hash), invoice_expiry_delta_secs, description_hash.danglingClone().cOpaqueStruct!, phantom_route_hintsWrapper.dangle().cOpaqueStruct!, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network))
66706704

66716705

66726706
}
6673-
public class func swift_create_invoice_from_channelmanager(channelmanager: ChannelManager, keys_manager: KeysInterface, network: LDKCurrency, amt_msat: Option_u64Z, description: String, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
6707+
public class func swift_create_invoice_from_channelmanager(channelmanager: ChannelManager, keys_manager: KeysInterface, logger: Logger, network: LDKCurrency, amt_msat: Option_u64Z, description: String, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
66746708

66756709

66766710
return withUnsafePointer(to: channelmanager.cOpaqueStruct!) { (channelmanagerPointer: UnsafePointer<LDKChannelManager>) in
66776711

6678-
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKStr(string: description, chars_is_owned: true), invoice_expiry_delta_secs))
6712+
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKStr(string: description, chars_is_owned: true), invoice_expiry_delta_secs))
66796713

66806714
}
66816715

66826716
}
6683-
public class func swift_create_invoice_from_channelmanager_with_description_hash(channelmanager: ChannelManager, keys_manager: KeysInterface, network: LDKCurrency, amt_msat: Option_u64Z, description_hash: Sha256, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
6717+
public class func swift_create_invoice_from_channelmanager_with_description_hash(channelmanager: ChannelManager, keys_manager: KeysInterface, logger: Logger, network: LDKCurrency, amt_msat: Option_u64Z, description_hash: Sha256, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
66846718

66856719

66866720
return withUnsafePointer(to: channelmanager.cOpaqueStruct!) { (channelmanagerPointer: UnsafePointer<LDKChannelManager>) in
66876721

6688-
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_with_description_hash(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, description_hash.danglingClone().cOpaqueStruct!, invoice_expiry_delta_secs))
6722+
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_with_description_hash(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, description_hash.danglingClone().cOpaqueStruct!, invoice_expiry_delta_secs))
66896723

66906724
}
66916725

66926726
}
6693-
public class func swift_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager: ChannelManager, keys_manager: KeysInterface, network: LDKCurrency, amt_msat: Option_u64Z, description_hash: Sha256, duration_since_epoch: UInt64, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
6727+
public class func swift_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager: ChannelManager, keys_manager: KeysInterface, logger: Logger, network: LDKCurrency, amt_msat: Option_u64Z, description_hash: Sha256, duration_since_epoch: UInt64, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
66946728

66956729

66966730
return withUnsafePointer(to: channelmanager.cOpaqueStruct!) { (channelmanagerPointer: UnsafePointer<LDKChannelManager>) in
66976731

6698-
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, description_hash.danglingClone().cOpaqueStruct!, duration_since_epoch, invoice_expiry_delta_secs))
6732+
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, description_hash.danglingClone().cOpaqueStruct!, duration_since_epoch, invoice_expiry_delta_secs))
66996733

67006734
}
67016735

67026736
}
6703-
public class func swift_create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager: ChannelManager, keys_manager: KeysInterface, network: LDKCurrency, amt_msat: Option_u64Z, description: String, duration_since_epoch: UInt64, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
6737+
public class func swift_create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager: ChannelManager, keys_manager: KeysInterface, logger: Logger, network: LDKCurrency, amt_msat: Option_u64Z, description: String, duration_since_epoch: UInt64, invoice_expiry_delta_secs: UInt32) -> Result_InvoiceSignOrCreationErrorZ {
67046738

67056739

67066740
return withUnsafePointer(to: channelmanager.cOpaqueStruct!) { (channelmanagerPointer: UnsafePointer<LDKChannelManager>) in
67076741

6708-
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_and_duration_since_epoch(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKStr(string: description, chars_is_owned: true), duration_since_epoch, invoice_expiry_delta_secs))
6742+
Result_InvoiceSignOrCreationErrorZ(pointer: create_invoice_from_channelmanager_and_duration_since_epoch(channelmanagerPointer, keys_manager.activate().cOpaqueStruct!, logger.activate().cOpaqueStruct!, network, amt_msat.danglingClone().cOpaqueStruct!, Bindings.new_LDKStr(string: description, chars_is_owned: true), duration_since_epoch, invoice_expiry_delta_secs))
67096743

67106744
}
67116745

@@ -6915,7 +6949,7 @@ withUnsafePointer(to: Bindings.array_to_tuple32(array: random_seed_bytes)) { (ra
69156949
*/
69166950

69176951
public class func get_ldk_swift_bindings_version() -> String {
6918-
return "a184e59437fe43f8e02f8e09c6a5a50745f4bf34"
6952+
return "bfac3427456fcff806561ab715683ca237f395ed"
69196953
}
69206954

69216955
}

ci/LDKSwift/Sources/LDKSwift/bindings/options/APIError.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,25 @@ APIError_clone(origPointer)
146146
return APIError(pointer: APIError_channel_unavailable(Bindings.new_LDKStr(string: err, chars_is_owned: true)));
147147
}
148148

149-
public class func monitor_update_failed() -> APIError {
149+
public class func monitor_update_in_progress() -> APIError {
150150

151-
return APIError(pointer: APIError_monitor_update_failed());
151+
return APIError(pointer: APIError_monitor_update_in_progress());
152152
}
153153

154154
public class func incompatible_shutdown_script(script: Bindings.ShutdownScript) -> APIError {
155155

156156
return APIError(pointer: APIError_incompatible_shutdown_script(script.danglingClone().cOpaqueStruct!));
157157
}
158158

159+
public class func eq(a: Bindings.APIError, b: Bindings.APIError) -> Bool {
160+
161+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKAPIError>) in
162+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKAPIError>) in
163+
APIError_eq(aPointer, bPointer)
164+
}
165+
};
166+
}
167+
159168
/* OPTION_METHODS_END */
160169

161170

ci/LDKSwift/Sources/LDKSwift/bindings/options/ClosureReason.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ ClosureReason_clone(origPointer)
139139
return ClosureReason(pointer: ClosureReason_outdated_channel_manager());
140140
}
141141

142+
public class func eq(a: Bindings.ClosureReason, b: Bindings.ClosureReason) -> Bool {
143+
144+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKClosureReason>) in
145+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKClosureReason>) in
146+
ClosureReason_eq(aPointer, bPointer)
147+
}
148+
};
149+
}
150+
142151
public func write() -> [UInt8] {
143152

144153
return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKClosureReason>) in

0 commit comments

Comments
 (0)