chore: reorg codegen logic and add test gobindings#950
chore: reorg codegen logic and add test gobindings#950graham-chainlink merged 2 commits intomainfrom
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the EVM operations generator implementation by splitting the previously monolithic EVM generator file into focused modules (config, ABI parsing, contract extraction, codegen), and adds pre-generated Go bindings under testdata to support upcoming gobindings-based generation work.
Changes:
- Split EVM generator responsibilities across new
config.go,abi.go,contract.go, andcodegen.gofiles while keepingevm.goas the handler entrypoint. - Update tests to use an external test package (
evm_test) and add targeted unit tests for codegen/name helpers. - Add
abigen-style Go bindings undertools/operations-gen/testdata/evm/gobindings/...for future generator evolution.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/operations-gen/testdata/evm/gobindings/v1_0_0/many_chain_multisig/many_chain_multisig.go | Adds generated gobindings fixture for ManyChainMultiSig contract. |
| tools/operations-gen/testdata/evm/gobindings/v1_0_0/link_token/link_token.go | Adds generated gobindings fixture for LinkToken contract. |
| tools/operations-gen/internal/families/evm/evm_golden_test.go | Moves golden tests to evm_test and updates references to exported APIs. |
| tools/operations-gen/internal/families/evm/evm.go | Leaves handler orchestration in place; delegates details to new modules. |
| tools/operations-gen/internal/families/evm/contract.go | Introduces ContractInfo extraction and struct definition collection. |
| tools/operations-gen/internal/families/evm/config.go | Introduces YAML config structs for EVM generator inputs/contracts/outputs. |
| tools/operations-gen/internal/families/evm/codegen_test.go | Adds unit tests for ToSnakeCase and big.Int import detection logic. |
| tools/operations-gen/internal/families/evm/codegen.go | Adds template data types + rendering + naming helper(s) and big.Int detection. |
| tools/operations-gen/internal/families/evm/abi_test.go | Updates ABI-related tests to evm_test and targets exported parsing helpers. |
| tools/operations-gen/internal/families/evm/abi.go | Adds ABI parsing, type mapping, and helper utilities used by codegen/extraction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|


Summary
This PR reorganizes the operations code generation logic by splitting the single
evm.gofile into:evm.go— Handlerconfig.go— YAML config structsabi.go— ABI parsingcontract.go—ContractInfoextraction and struct def collectioncodegen.go— template data types, rendering, and naming helpersThis PR does not introduce any code logic change, it is purely a code reorg to improve readability and code management. It also introduces go bindings under
testdatato anticipate upcoming changes which will update the code generation logic to build on top of gobindings (#949).