@@ -7,46 +7,26 @@ public class CommitmentUpdate: NativeTypeWrapper {
7
7
8
8
9
9
/* DEFAULT_CONSTRUCTOR_START */
10
- public init ( update_add_htlcs_arg: [ UpdateAddHTLC ] , update_fulfill_htlcs_arg: [ UpdateFulfillHTLC ] , update_fail_htlcs_arg: [ UpdateFailHTLC ] , update_fail_malformed_htlcs_arg: [ UpdateFailMalformedHTLC ] , update_fee_arg: UpdateFee , commitment_signed_arg: CommitmentSigned ) {
10
+ internal init ( update_add_htlcs_arg: [ LDKUpdateAddHTLC ] , update_fulfill_htlcs_arg: [ LDKUpdateFulfillHTLC ] , update_fail_htlcs_arg: [ LDKUpdateFailHTLC ] , update_fail_malformed_htlcs_arg: [ LDKUpdateFailMalformedHTLC ] , update_fee_arg: UpdateFee , commitment_signed_arg: CommitmentSigned ) {
11
11
Self . instanceCounter += 1
12
12
self . instanceNumber = Self . instanceCounter
13
13
14
- let update_add_htlcs_argUnwrapped = update_add_htlcs_arg. map { ( update_add_htlcs_argCurrentValue) in
15
- update_add_htlcs_argCurrentValue
16
- . danglingClone ( ) . cOpaqueStruct!
17
- }
18
-
19
- let update_add_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateAddHTLCZWrapper ( array: update_add_htlcs_argUnwrapped)
14
+ let update_add_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateAddHTLCZWrapper ( array: update_add_htlcs_arg)
20
15
defer {
21
16
update_add_htlcs_argWrapper. noOpRetain ( )
22
17
}
23
18
24
- let update_fulfill_htlcs_argUnwrapped = update_fulfill_htlcs_arg. map { ( update_fulfill_htlcs_argCurrentValue) in
25
- update_fulfill_htlcs_argCurrentValue
26
- . danglingClone ( ) . cOpaqueStruct!
27
- }
28
-
29
- let update_fulfill_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFulfillHTLCZWrapper ( array: update_fulfill_htlcs_argUnwrapped)
19
+ let update_fulfill_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFulfillHTLCZWrapper ( array: update_fulfill_htlcs_arg)
30
20
defer {
31
21
update_fulfill_htlcs_argWrapper. noOpRetain ( )
32
22
}
33
23
34
- let update_fail_htlcs_argUnwrapped = update_fail_htlcs_arg. map { ( update_fail_htlcs_argCurrentValue) in
35
- update_fail_htlcs_argCurrentValue
36
- . danglingClone ( ) . cOpaqueStruct!
37
- }
38
-
39
- let update_fail_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFailHTLCZWrapper ( array: update_fail_htlcs_argUnwrapped)
24
+ let update_fail_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFailHTLCZWrapper ( array: update_fail_htlcs_arg)
40
25
defer {
41
26
update_fail_htlcs_argWrapper. noOpRetain ( )
42
27
}
43
28
44
- let update_fail_malformed_htlcs_argUnwrapped = update_fail_malformed_htlcs_arg. map { ( update_fail_malformed_htlcs_argCurrentValue) in
45
- update_fail_malformed_htlcs_argCurrentValue
46
- . danglingClone ( ) . cOpaqueStruct!
47
- }
48
-
49
- let update_fail_malformed_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFailMalformedHTLCZWrapper ( array: update_fail_malformed_htlcs_argUnwrapped)
29
+ let update_fail_malformed_htlcs_argWrapper = Bindings . new_LDKCVec_UpdateFailMalformedHTLCZWrapper ( array: update_fail_malformed_htlcs_arg)
50
30
defer {
51
31
update_fail_malformed_htlcs_argWrapper. noOpRetain ( )
52
32
}
@@ -73,18 +53,47 @@ public class CommitmentUpdate: NativeTypeWrapper {
73
53
}
74
54
75
55
/* STRUCT_METHODS_START */
56
+ public convenience init ( update_add_htlcs_arg: [ UpdateAddHTLC ] , update_fulfill_htlcs_arg: [ UpdateFulfillHTLC ] , update_fail_htlcs_arg: [ UpdateFailHTLC ] , update_fail_malformed_htlcs_arg: [ UpdateFailMalformedHTLC ] , update_fee_arg: UpdateFee , commitment_signed_arg: CommitmentSigned ) {
57
+
58
+ let update_add_htlcs_argUnwrapped = update_add_htlcs_arg. map { ( update_add_htlcs_argCurrentValue) in
59
+ update_add_htlcs_argCurrentValue
60
+ . danglingClone ( ) . cOpaqueStruct!
61
+ }
62
+
63
+ let update_fulfill_htlcs_argUnwrapped = update_fulfill_htlcs_arg. map { ( update_fulfill_htlcs_argCurrentValue) in
64
+ update_fulfill_htlcs_argCurrentValue
65
+ . danglingClone ( ) . cOpaqueStruct!
66
+ }
67
+
68
+ let update_fail_htlcs_argUnwrapped = update_fail_htlcs_arg. map { ( update_fail_htlcs_argCurrentValue) in
69
+ update_fail_htlcs_argCurrentValue
70
+ . danglingClone ( ) . cOpaqueStruct!
71
+ }
72
+
73
+ let update_fail_malformed_htlcs_argUnwrapped = update_fail_malformed_htlcs_arg. map { ( update_fail_malformed_htlcs_argCurrentValue) in
74
+ update_fail_malformed_htlcs_argCurrentValue
75
+ . danglingClone ( ) . cOpaqueStruct!
76
+ }
77
+
78
+ self . init ( update_add_htlcs_arg: update_add_htlcs_argUnwrapped, update_fulfill_htlcs_arg: update_fulfill_htlcs_argUnwrapped, update_fail_htlcs_arg: update_fail_htlcs_argUnwrapped, update_fail_malformed_htlcs_arg: update_fail_malformed_htlcs_argUnwrapped, update_fee_arg: update_fee_arg, commitment_signed_arg: commitment_signed_arg) ;
79
+ }
76
80
77
81
public func set_update_add_htlcs( val: [ UpdateAddHTLC ] ) -> Void {
78
82
79
- let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
80
- this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
81
-
82
83
let valUnwrapped = val. map { ( valCurrentValue) in
83
84
valCurrentValue
84
85
. danglingClone ( ) . cOpaqueStruct!
85
86
}
86
87
87
- let valWrapper = Bindings . new_LDKCVec_UpdateAddHTLCZWrapper ( array: valUnwrapped)
88
+ return self . set_update_add_htlcs ( val: valUnwrapped) ;
89
+ }
90
+
91
+ internal func set_update_add_htlcs( val: [ LDKUpdateAddHTLC ] ) -> Void {
92
+
93
+ let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
94
+ this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
95
+
96
+ let valWrapper = Bindings . new_LDKCVec_UpdateAddHTLCZWrapper ( array: val)
88
97
defer {
89
98
valWrapper. noOpRetain ( )
90
99
}
@@ -94,15 +103,20 @@ public class CommitmentUpdate: NativeTypeWrapper {
94
103
95
104
public func set_update_fulfill_htlcs( val: [ UpdateFulfillHTLC ] ) -> Void {
96
105
97
- let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
98
- this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
99
-
100
106
let valUnwrapped = val. map { ( valCurrentValue) in
101
107
valCurrentValue
102
108
. danglingClone ( ) . cOpaqueStruct!
103
109
}
104
110
105
- let valWrapper = Bindings . new_LDKCVec_UpdateFulfillHTLCZWrapper ( array: valUnwrapped)
111
+ return self . set_update_fulfill_htlcs ( val: valUnwrapped) ;
112
+ }
113
+
114
+ internal func set_update_fulfill_htlcs( val: [ LDKUpdateFulfillHTLC ] ) -> Void {
115
+
116
+ let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
117
+ this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
118
+
119
+ let valWrapper = Bindings . new_LDKCVec_UpdateFulfillHTLCZWrapper ( array: val)
106
120
defer {
107
121
valWrapper. noOpRetain ( )
108
122
}
@@ -112,15 +126,20 @@ public class CommitmentUpdate: NativeTypeWrapper {
112
126
113
127
public func set_update_fail_htlcs( val: [ UpdateFailHTLC ] ) -> Void {
114
128
115
- let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
116
- this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
117
-
118
129
let valUnwrapped = val. map { ( valCurrentValue) in
119
130
valCurrentValue
120
131
. danglingClone ( ) . cOpaqueStruct!
121
132
}
122
133
123
- let valWrapper = Bindings . new_LDKCVec_UpdateFailHTLCZWrapper ( array: valUnwrapped)
134
+ return self . set_update_fail_htlcs ( val: valUnwrapped) ;
135
+ }
136
+
137
+ internal func set_update_fail_htlcs( val: [ LDKUpdateFailHTLC ] ) -> Void {
138
+
139
+ let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
140
+ this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
141
+
142
+ let valWrapper = Bindings . new_LDKCVec_UpdateFailHTLCZWrapper ( array: val)
124
143
defer {
125
144
valWrapper. noOpRetain ( )
126
145
}
@@ -130,15 +149,20 @@ public class CommitmentUpdate: NativeTypeWrapper {
130
149
131
150
public func set_update_fail_malformed_htlcs( val: [ UpdateFailMalformedHTLC ] ) -> Void {
132
151
133
- let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
134
- this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
135
-
136
152
let valUnwrapped = val. map { ( valCurrentValue) in
137
153
valCurrentValue
138
154
. danglingClone ( ) . cOpaqueStruct!
139
155
}
140
156
141
- let valWrapper = Bindings . new_LDKCVec_UpdateFailMalformedHTLCZWrapper ( array: valUnwrapped)
157
+ return self . set_update_fail_malformed_htlcs ( val: valUnwrapped) ;
158
+ }
159
+
160
+ internal func set_update_fail_malformed_htlcs( val: [ LDKUpdateFailMalformedHTLC ] ) -> Void {
161
+
162
+ let this_ptrPointer = UnsafeMutablePointer< LDKCommitmentUpdate> . allocate( capacity: 1 )
163
+ this_ptrPointer. initialize ( to: self . cOpaqueStruct!)
164
+
165
+ let valWrapper = Bindings . new_LDKCVec_UpdateFailMalformedHTLCZWrapper ( array: val)
142
166
defer {
143
167
valWrapper. noOpRetain ( )
144
168
}
0 commit comments