Migrate contract tests to strict TypeScript - #191
Open
mswilkison wants to merge 2 commits into
Open
mswilkison wants to merge 2 commits into
mswilkison wants to merge 2 commits into
Conversation
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The contract tests still use JavaScript even though the Hardhat configuration and deployment scripts already use TypeScript. Migrate all 10 test suites and their shared helper to strict TypeScript with generated ethers v5 contract bindings. Contract calls, proposal arguments, signers, and transaction receipts now have concrete types, and previously implicit globals belong to their test suites.
yarn formatchecks TypeScript and rejects unhandled or misused promises through the existing CI job. TypeChain generates bindings during builds, type checking, and packaging. The export configuration retains the JavaScript deployment layout and excludes tests and generated bindings. The migration preserves the delegation awaits from #189. ESLint 8.57.1 supports the TypeScript lint plugin while retaining the repository's existing Keep configuration.This PR is based on #190, which builds on #182. Retarget it to
mainafter those prerequisites merge. It also includes the two-line fix from #189, which can merge independently.Validation completed with Node 22.23.1 and Yarn 1.22.22:
hardhat cleanfollowed byyarn formatpass, including fresh compilation, type generation, strict checking, ESLint, Solhint, and formatting.Expected event "DelegateVotesChanged" to be emitted, but it wasn't#111 produces exactly twono-floating-promiseserrors; both awaits are restored.yarn prepackpass. The tarball contains all 13 JavaScript deployment modules and the verification task, with no tests or generated TypeChain files; all 13 exported deployment modules load successfully.GitHub Actions also passed: Solidity tests, deployment dry run, and Slither, type checking, lint, and formatting, and documentation preview.
Closes #5