OpenZeppelin / OpenZeppelin/compact-contracts

dev: type-check specs and simulators in yarn types

Open
#895 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CI enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.