Skip to content

Commit

Permalink
lang: Make tuple struct fields public in declare_program! (coral-xy…
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptopapi997 authored May 30, 2024
1 parent cd82627 commit 5601702
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
- 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)).
- lang: Make tuple struct fields public in `declare_program!` ([#2994](https://github.com/coral-xyz/anchor/pull/2994)).

### Breaking

Expand Down
6 changes: 5 additions & 1 deletion lang/attribute/program/src/declare_program/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ pub fn convert_idl_type_def_to_ts(
}
},
|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! {
#declare_struct (#(#tys,)*);
}
Expand Down

0 comments on commit 5601702

Please sign in to comment.