@@ -59,6 +59,8 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
59
59
constructor_argument_prep += current_prep
60
60
elif current_argument_details .rust_obj == 'LDK' + current_argument_details .swift_type :
61
61
passed_argument_name += '.cOpaqueStruct!'
62
+ elif current_argument_details .rust_obj == 'LDKC' + current_argument_details .swift_type :
63
+ passed_argument_name += '.cOpaqueStruct!'
62
64
63
65
swift_arguments .append (f'{ argument_name } : { current_argument_details .swift_type } ' )
64
66
native_arguments .append (f'{ passed_argument_name } ' )
@@ -134,6 +136,9 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
134
136
if current_return_type .rust_obj is None and current_return_type .swift_type .startswith ('[' ):
135
137
current_swift_return_type = current_return_type .swift_raw_type
136
138
139
+ if current_return_type .swift_type .startswith ('[' ) and not current_return_type .is_native_primitive and not current_return_type .swift_type .startswith ('[UInt' ):
140
+ current_swift_return_type = current_return_type .swift_raw_type .replace ('[' , '[LDK' )
141
+
137
142
current_replacement = current_replacement .replace ('func methodName(' , f'func { current_method_name } (' )
138
143
139
144
if is_clone_method :
@@ -181,6 +186,8 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
181
186
# native_arguments.append(f'{passed_argument_name}')
182
187
if current_argument_details .rust_obj == 'LDK' + current_argument_details .swift_type and not current_argument_details .is_ptr :
183
188
native_arguments .append (f'{ passed_argument_name } .cOpaqueStruct!' )
189
+ elif current_argument_details .rust_obj == 'LDKC' + current_argument_details .swift_type and not current_argument_details .is_ptr :
190
+ native_arguments .append (f'{ passed_argument_name } .cOpaqueStruct!' )
184
191
elif current_argument_details .rust_obj is not None and current_argument_details .rust_obj .startswith (
185
192
'LDK' ) and current_argument_details .swift_type .startswith ('[' ):
186
193
native_arguments .append (f'Bindings.new_{ current_argument_details .rust_obj } (array: { passed_argument_name } )' )
0 commit comments