@@ -14,6 +14,15 @@ public class APIError: NativeTypeWrapper {
14
14
super. init ( conflictAvoidingVariableName: 0 )
15
15
}
16
16
17
+ public init ( pointer: LDKAPIError , anchor: NativeTypeWrapper ) {
18
+ Self . instanceCounter += 1
19
+ self . instanceNumber = Self . instanceCounter
20
+ self . cOpaqueStruct = pointer
21
+ super. init ( conflictAvoidingVariableName: 0 )
22
+ self . dangling = true
23
+ try ! self . addAnchor ( anchor: anchor)
24
+ }
25
+
17
26
/* OPTION_METHODS_START */
18
27
19
28
public enum APIErrorValueType {
@@ -43,35 +52,35 @@ public class APIError: NativeTypeWrapper {
43
52
if self . cOpaqueStruct? . tag != LDKAPIError_APIMisuseError {
44
53
return nil
45
54
}
46
- return APIMisuseError ( pointer: self . cOpaqueStruct!. api_misuse_error)
55
+ return APIMisuseError ( pointer: self . cOpaqueStruct!. api_misuse_error, anchor : self )
47
56
}
48
57
49
58
public func getValueAsFeeRateTooHigh( ) -> FeeRateTooHigh ? {
50
59
if self . cOpaqueStruct? . tag != LDKAPIError_FeeRateTooHigh {
51
60
return nil
52
61
}
53
- return FeeRateTooHigh ( pointer: self . cOpaqueStruct!. fee_rate_too_high)
62
+ return FeeRateTooHigh ( pointer: self . cOpaqueStruct!. fee_rate_too_high, anchor : self )
54
63
}
55
64
56
65
public func getValueAsRouteError( ) -> RouteError ? {
57
66
if self . cOpaqueStruct? . tag != LDKAPIError_RouteError {
58
67
return nil
59
68
}
60
- return RouteError ( pointer: self . cOpaqueStruct!. route_error)
69
+ return RouteError ( pointer: self . cOpaqueStruct!. route_error, anchor : self )
61
70
}
62
71
63
72
public func getValueAsChannelUnavailable( ) -> ChannelUnavailable ? {
64
73
if self . cOpaqueStruct? . tag != LDKAPIError_ChannelUnavailable {
65
74
return nil
66
75
}
67
- return ChannelUnavailable ( pointer: self . cOpaqueStruct!. channel_unavailable)
76
+ return ChannelUnavailable ( pointer: self . cOpaqueStruct!. channel_unavailable, anchor : self )
68
77
}
69
78
70
79
public func getValueAsIncompatibleShutdownScript( ) -> IncompatibleShutdownScript ? {
71
80
if self . cOpaqueStruct? . tag != LDKAPIError_IncompatibleShutdownScript {
72
81
return nil
73
82
}
74
- return IncompatibleShutdownScript ( pointer: self . cOpaqueStruct!. incompatible_shutdown_script)
83
+ return IncompatibleShutdownScript ( pointer: self . cOpaqueStruct!. incompatible_shutdown_script, anchor : self )
75
84
}
76
85
77
86
@@ -143,12 +152,19 @@ APIError_clone(origPointer)
143
152
144
153
145
154
146
- public class APIMisuseError {
155
+ public class APIMisuseError : NativeTypeWrapper {
147
156
148
157
149
158
var cOpaqueStruct : LDKAPIError_LDKAPIMisuseError_Body ? ;
150
159
fileprivate init ( pointer: LDKAPIError_LDKAPIMisuseError_Body ) {
151
160
self . cOpaqueStruct = pointer
161
+ super. init ( conflictAvoidingVariableName: 0 )
162
+ }
163
+ fileprivate init ( pointer: LDKAPIError_LDKAPIMisuseError_Body , anchor: NativeTypeWrapper ) {
164
+ self . cOpaqueStruct = pointer
165
+ super. init ( conflictAvoidingVariableName: 0 )
166
+ self . dangling = true
167
+ try ! self . addAnchor ( anchor: anchor)
152
168
}
153
169
154
170
@@ -161,12 +177,19 @@ APIError_clone(origPointer)
161
177
}
162
178
163
179
164
- public class FeeRateTooHigh {
180
+ public class FeeRateTooHigh : NativeTypeWrapper {
165
181
166
182
167
183
var cOpaqueStruct : LDKAPIError_LDKFeeRateTooHigh_Body ? ;
168
184
fileprivate init ( pointer: LDKAPIError_LDKFeeRateTooHigh_Body ) {
169
185
self . cOpaqueStruct = pointer
186
+ super. init ( conflictAvoidingVariableName: 0 )
187
+ }
188
+ fileprivate init ( pointer: LDKAPIError_LDKFeeRateTooHigh_Body , anchor: NativeTypeWrapper ) {
189
+ self . cOpaqueStruct = pointer
190
+ super. init ( conflictAvoidingVariableName: 0 )
191
+ self . dangling = true
192
+ try ! self . addAnchor ( anchor: anchor)
170
193
}
171
194
172
195
@@ -183,12 +206,19 @@ APIError_clone(origPointer)
183
206
}
184
207
185
208
186
- public class RouteError {
209
+ public class RouteError : NativeTypeWrapper {
187
210
188
211
189
212
var cOpaqueStruct : LDKAPIError_LDKRouteError_Body ? ;
190
213
fileprivate init ( pointer: LDKAPIError_LDKRouteError_Body ) {
191
214
self . cOpaqueStruct = pointer
215
+ super. init ( conflictAvoidingVariableName: 0 )
216
+ }
217
+ fileprivate init ( pointer: LDKAPIError_LDKRouteError_Body , anchor: NativeTypeWrapper ) {
218
+ self . cOpaqueStruct = pointer
219
+ super. init ( conflictAvoidingVariableName: 0 )
220
+ self . dangling = true
221
+ try ! self . addAnchor ( anchor: anchor)
192
222
}
193
223
194
224
@@ -201,12 +231,19 @@ APIError_clone(origPointer)
201
231
}
202
232
203
233
204
- public class ChannelUnavailable {
234
+ public class ChannelUnavailable : NativeTypeWrapper {
205
235
206
236
207
237
var cOpaqueStruct : LDKAPIError_LDKChannelUnavailable_Body ? ;
208
238
fileprivate init ( pointer: LDKAPIError_LDKChannelUnavailable_Body ) {
209
239
self . cOpaqueStruct = pointer
240
+ super. init ( conflictAvoidingVariableName: 0 )
241
+ }
242
+ fileprivate init ( pointer: LDKAPIError_LDKChannelUnavailable_Body , anchor: NativeTypeWrapper ) {
243
+ self . cOpaqueStruct = pointer
244
+ super. init ( conflictAvoidingVariableName: 0 )
245
+ self . dangling = true
246
+ try ! self . addAnchor ( anchor: anchor)
210
247
}
211
248
212
249
@@ -219,18 +256,25 @@ APIError_clone(origPointer)
219
256
}
220
257
221
258
222
- public class IncompatibleShutdownScript {
259
+ public class IncompatibleShutdownScript : NativeTypeWrapper {
223
260
224
261
225
262
var cOpaqueStruct : LDKAPIError_LDKIncompatibleShutdownScript_Body ? ;
226
263
fileprivate init ( pointer: LDKAPIError_LDKIncompatibleShutdownScript_Body ) {
227
264
self . cOpaqueStruct = pointer
265
+ super. init ( conflictAvoidingVariableName: 0 )
266
+ }
267
+ fileprivate init ( pointer: LDKAPIError_LDKIncompatibleShutdownScript_Body , anchor: NativeTypeWrapper ) {
268
+ self . cOpaqueStruct = pointer
269
+ super. init ( conflictAvoidingVariableName: 0 )
270
+ self . dangling = true
271
+ try ! self . addAnchor ( anchor: anchor)
228
272
}
229
273
230
274
231
275
232
276
public func getScript( ) -> ShutdownScript {
233
- return ShutdownScript ( pointer: self . cOpaqueStruct!. script) . dangle ( )
277
+ return ShutdownScript ( pointer: self . cOpaqueStruct!. script, anchor : self )
234
278
}
235
279
236
280
0 commit comments