OpenZeppelin / OpenZeppelin/compact-contracts

dev: add integration tests for the moved multisig examples

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

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
55
Forks
29
Avg merge
5d 7h
Merged PRs (30d)
25

Description

Context

The multisig examples (MultisigSignatureMintBurn, MultisigSignatureTreasury, MultisigProposalTreasury) were moved out of src/multisig/examples/ into test/integration/_mocks/ and converted from modules (+ test mocks) into self-contained top-level contracts. This keeps them as usage examples while positioning them to be exercised as integration-test fixtures — they compose production modules into one deployable contract, which is exactly what test/integration/ is for.

Their previous unit tests, simulators, and mocks were removed in the same change. No integration tests have been added yet — that is the purpose of this issue.

Moved contracts (point of reference)

  • contracts/test/integration/_mocks/MultisigSignatureMintBurn.compact — signature-authorized mint/burn of a native shielded token (3 signers, threshold 2).
  • contracts/test/integration/_mocks/MultisigSignatureTreasury.compact — signature-authorized single-tx spend from a stateless shielded treasury.
  • contracts/test/integration/_mocks/MultisigProposalTreasury.compact — caller-authorized on-chain proposal governance over a shielded treasury.

Task

Add integration coverage for the three, mirroring the existing test/integration/specs/nativeShieldedToken/ suite:

  • Wire each contract into the integration compile step (compact:integration in contracts/package.json).
  • Add fixtures under test/integration/fixtures/ (signer commitments, salts, coins, recipients).
  • Add specs under test/integration/specs/ covering the happy paths (deposit / mint / burn / execute / propose→approve→execute) plus key failure modes (non-signer, below-threshold, wrong token color, replay).
  • Decide unit vs network suite — the nativeShieldedToken/ subtree runs under vitest.integration-net.config.ts; the signature examples may want a full-proof path too.

Notes

  • ECDSA verification is stubbed in EcdsaSignerManager (see #629), so signature-path tests can only verify membership / threshold / structure, not real signatures, until the primitive lands.
  • These examples were relocated from src/multisig/examples/ (originally introduced in #628).

Relates to #628.

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/package.json and the existing test/integration/specs/nativeShieldedToken/ suite, then inspect the three contracts in test/integration/_mocks/. Add integration fixtures and specs for the listed happy paths and failure modes, wiring all contracts into compact:integration. Done means the suites compile and cover membership, thresholds, token color, replay, and proposal execution within the chosen test configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.