diff --git a/CHANGELOG.md b/CHANGELOG.md index 021442eaf0..d6c733c9e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The minor version will be incremented upon a breaking change and the patch versi - ts: Load workspace programs on-demand rather than loading all of them at once ([#2579](https://github.com/coral-xyz/anchor/pull/2579)). - lang: Fix `associated_token::token_program` constraint ([#2603](https://github.com/coral-xyz/anchor/pull/2603)). - cli: Fix `anchor account` command panicking outside of workspace ([#2620](https://github.com/coral-xyz/anchor/pull/2620)). +- lang: IDL named enum variant fields are now camelCase as opposed to snake_case, consistent with the other IDL types ([#2633](https://github.com/coral-xyz/anchor/pull/2633)). ### Breaking diff --git a/lang/syn/src/idl/parse/file.rs b/lang/syn/src/idl/parse/file.rs index 3a2b331762..e12dd165e5 100644 --- a/lang/syn/src/idl/parse/file.rs +++ b/lang/syn/src/idl/parse/file.rs @@ -384,7 +384,8 @@ fn parse_ty_defs(ctx: &CrateContext, no_docs: bool) -> Result { assert.deepEqual(unit.enumField.unit, {}); // Named - const x = new anchor.BN(1); - const y = new anchor.BN(2); - const named = await testAccountEnum({ named: { x, y } }); - assert(named.enumField.named.x.eq(x)); - assert(named.enumField.named.y.eq(y)); + const pointX = new anchor.BN(1); + const pointY = new anchor.BN(2); + const named = await testAccountEnum({ named: { pointX, pointY } }); + assert(named.enumField.named.pointX.eq(pointX)); + assert(named.enumField.named.pointY.eq(pointY)); // Unnamed const tupleArg = [1, 2, 3, 4] as const;