lang: Make tuple struct fields public in `declare_program!` (#2994)

This commit is contained in:
cryptopapi997 2024-05-30 23:07:29 +02:00 committed by GitHub
parent cd826271c2
commit 56017029b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- lang: Fix instruction return type generation with `declare_program!` ([#2977](https://github.com/coral-xyz/anchor/pull/2977)). - lang: Fix instruction return type generation with `declare_program!` ([#2977](https://github.com/coral-xyz/anchor/pull/2977)).
- cli: Fix IDL write getting corrupted from retries ([#2964](https://github.com/coral-xyz/anchor/pull/2964)). - cli: Fix IDL write getting corrupted from retries ([#2964](https://github.com/coral-xyz/anchor/pull/2964)).
- idl: Fix `unexpected_cfgs` build warning ([#2992](https://github.com/coral-xyz/anchor/pull/2992)). - idl: Fix `unexpected_cfgs` build warning ([#2992](https://github.com/coral-xyz/anchor/pull/2992)).
- lang: Make tuple struct fields public in `declare_program!` ([#2994](https://github.com/coral-xyz/anchor/pull/2994)).
### Breaking ### Breaking

View File

@ -211,7 +211,11 @@ pub fn convert_idl_type_def_to_ts(
} }
}, },
|tys| { |tys| {
let tys = tys.iter().map(convert_idl_type_to_syn_type); let tys = tys
.iter()
.map(convert_idl_type_to_syn_type)
.map(|ty| quote! { pub #ty });
quote! { quote! {
#declare_struct (#(#tys,)*); #declare_struct (#(#tys,)*);
} }