diff --git a/CHANGELOG.md b/CHANGELOG.md index 4470fb87fe..54aa1cba7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The minor version will be incremented upon a breaking change and the patch versi ### Features +- lang: Implement `Arbitrary` trait for the anchor-generated instruction module when the program is compiled with the arbitrary feature (requires the arbitrary crate) ([2518](https://github.com/coral-xyz/anchor/pull/2518)). - idl: Allow overriding the idl build toolchain with the `RUSTUP_TOOLCHAIN` environment variable ([#2941](https://github.com/coral-xyz/anchor/pull/2941])) - avm: Support customizing the installation location using `AVM_HOME` environment variable ([#2917](https://github.com/coral-xyz/anchor/pull/2917)) - idl, ts: Add accounts resolution for associated token accounts ([#2927](https://github.com/coral-xyz/anchor/pull/2927)) diff --git a/lang/syn/src/codegen/program/instruction.rs b/lang/syn/src/codegen/program/instruction.rs index 8e6ea4c487..c68ec8f5cc 100644 --- a/lang/syn/src/codegen/program/instruction.rs +++ b/lang/syn/src/codegen/program/instruction.rs @@ -44,6 +44,7 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { quote! { /// Instruction. #[derive(AnchorSerialize, AnchorDeserialize)] + #[cfg_attr(feature = "arbitrary", derive(Debug, Clone, arbitrary::Arbitrary))] pub struct #ix_name_camel; #ix_data_trait @@ -52,6 +53,7 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream { quote! { /// Instruction. #[derive(AnchorSerialize, AnchorDeserialize)] + #[cfg_attr(feature = "arbitrary", derive(Debug, Clone, arbitrary::Arbitrary))] pub struct #ix_name_camel { #(#raw_args),* }