Skip to content

Commit 68a6d3e

Browse files
authored
test: add NonceManager with per-account lock and concurrency tests (#6)
Implements the nonce module needed for issue #5 acceptance criteria: - src/nonce/lock.ts: FIFO async mutex keyed by account (fixes vero-core-engine#164, #183) - src/nonce/index.ts: NonceManager with atomic reserve() and refresh() - src/__tests__/nonce.concurrency.test.ts: concurrency regression tests Concurrency tests cover: - N concurrent reserve() calls yield N distinct, gapless sequences - Concurrent first-reservations do not duplicate sequences - Interleaved refresh() + reserve() produce no duplicates (vero-core-engine#183) - Different accounts proceed in parallel, not serially - High-concurrency (50 callers) scenario All checks pass: npm test (62/62), typecheck, lint, build. Closes #5
1 parent 3a78d81 commit 68a6d3e

4 files changed

Lines changed: 676 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)