Skip to content

Fix EVM Bindings generator struct prefix bug#365

Merged
silaslenihan merged 1 commit intomainfrom
fix/bindings-struct-prefixes
Apr 9, 2026
Merged

Fix EVM Bindings generator struct prefix bug#365
silaslenihan merged 1 commit intomainfrom
fix/bindings-struct-prefixes

Conversation

@silaslenihan
Copy link
Copy Markdown
Collaborator

@silaslenihan silaslenihan commented Apr 9, 2026

Previously only tmplStruct.Name was being updated. tmplField.Type is set earlier in bindStructType as a plain string and is what the template uses for struct fields in sourcecre.go.tpl ({{.Type}}), not the dynamic bindtype path used for method args.

So you could get:
type Foo struct { ... } ← name was stripped
tems []MyContractFoo ← field still pointed at the old name
That’s invalid Go and fails to compile.

Now we are sure to rename the old field names with the new names

@silaslenihan silaslenihan force-pushed the fix/bindings-struct-prefixes branch from dd5d011 to d756c27 Compare April 9, 2026 15:26
@silaslenihan silaslenihan marked this pull request as ready for review April 9, 2026 15:34
@silaslenihan silaslenihan requested a review from a team as a code owner April 9, 2026 15:34
@silaslenihan silaslenihan requested a review from nolag April 9, 2026 15:35
Copy link
Copy Markdown
Contributor

@nolag nolag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that it wasn't possible to generate code that was sometimes valid that would now be broken. If that's not the case, you may need to create an alias to the broken name...

@silaslenihan silaslenihan added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit e372025 Apr 9, 2026
26 checks passed
@silaslenihan silaslenihan deleted the fix/bindings-struct-prefixes branch April 9, 2026 16:17
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