Skip to content

fix(lang-v2): honor wincode enum tags in idl and init space#4819

Open
0x4ka5h wants to merge 4 commits into
otter-sec:anchor-nextfrom
Otter-0x4ka5h:fix/v2-wincode-enum-tags
Open

fix(lang-v2): honor wincode enum tags in idl and init space#4819
0x4ka5h wants to merge 4 commits into
otter-sec:anchor-nextfrom
Otter-0x4ka5h:fix/v2-wincode-enum-tags

Conversation

@0x4ka5h

@0x4ka5h 0x4ka5h commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Finding
InitSpace and enum IDL generation assumed one-byte enum tags, dropping custom wincode tag encodings and per-variant tag values.

Fix
This PR honors wincode(tag_encoding = ...) and variant #[wincode(tag = ...)] metadata in sizing and generated enum IDL. Added regression tests for custom tag encodings and tags.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the OtterSec Team on Vercel.

A member of the Team first needs to authorize it.

@swaroop-osec

Copy link
Copy Markdown
Collaborator

@0x4ka5h please address the failed tests.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 32.48408% with 106 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (anchor-next@e056cc1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
lang-v2/derive/src/wincode_attrs.rs 35.08% 37 Missing ⚠️
lang-v2/derive/src/lib.rs 27.08% 35 Missing ⚠️
lang-v2/derive/src/idl.rs 0.00% 17 Missing ⚠️
lang-v2/derive/src/init_space.rs 45.16% 17 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##             anchor-next    #4819   +/-   ##
==============================================
  Coverage               ?   63.29%           
==============================================
  Files                  ?      127           
  Lines                  ?    13806           
  Branches               ?        0           
==============================================
  Hits                   ?     8738           
  Misses                 ?     5068           
  Partials               ?        0           
Flag Coverage Δ
v2 63.29% <32.48%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants