Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- idl: Fix potential panic on external type resolution ([#2954](https://github.com/coral-xyz/anchor/pull/2954)).
- lang: Fix using defined types in instruction parameters with `declare_program!` ([#2959](https://github.com/coral-xyz/anchor/pull/2959)).
- lang: Fix using const generics with `declare_program!` ([#2965](https://github.com/coral-xyz/anchor/pull/2965)).
- lang: Fix bytes being incorrectly converted from IDL to Rust with `declare_program!` ([#2966](https://github.com/coral-xyz/anchor/pull/2966)).

### Breaking

Expand Down
5 changes: 4 additions & 1 deletion lang/attribute/program/src/declare_program/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ pub fn gen_accounts_common(idl: &Idl, prefix: &str) -> proc_macro2::TokenStream
}

pub fn convert_idl_type_to_syn_type(ty: &IdlType) -> syn::Type {
syn::parse_str(&convert_idl_type_to_str(ty)).unwrap()
match ty {
IdlType::Bytes => syn::parse_str("Vec<u8>").unwrap(),
_ => syn::parse_str(&convert_idl_type_to_str(ty)).unwrap(),
}
Comment thread
cryptopapi997 marked this conversation as resolved.
Outdated
}

// TODO: Impl `ToString` for `IdlType`
Expand Down