OpenZeppelin / OpenZeppelin/compact-contracts
dev: type-check specs and simulators in yarn types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
contracts/tsconfig.json includes only src/**/test/witnesses/**/*.ts, so yarn types never type-checks a spec or a simulator. Vitest does not type-check either, so type errors in tests only surface when someone runs tsc by hand. The include was narrowed from src/**/*.ts in #284 without a stated reason; the file drives yarn types only (--noEmit), so widening does not touch dist.
Widening to src/**/test/**/*.ts today reports 14 errors: seven rootDir complaints because test-utils/ sits outside src, four ctx.ledger typed unknown in ShieldedAccessControl.test.ts, two never property reads in test-utils/fixtures/ecdsa.ts, and one missing ZswapCoinPublicKey export on the MockOwnable artifact used by ZOwnablePK.test.ts. Widen the include, fix those, and keep yarn types green for specs and simulators from then on.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with contracts/tsconfig.json and run yarn types after widening the include from witnesses to src//test//*.ts. Investigate the reported rootDir errors involving test-utils, the ctx.ledger types in ShieldedAccessControl.test.ts, never property reads in test-utils/fixtures/ecdsa.ts, and the missing ZswapCoinPublicKey export used by ZOwnablePK.test.ts. Done means yarn types passes while checking specs and simulators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100