Skip to content

Issuance forge migration#1298

Merged
RembrandtK merged 4 commits intomainfrom
issuance-forge-migration
Feb 27, 2026
Merged

Issuance forge migration#1298
RembrandtK merged 4 commits intomainfrom
issuance-forge-migration

Conversation

@RembrandtK
Copy link
Contributor

For upcoming audit wrote new issuance changes using Forge testing instead of Hardhat.

Migrating existing issuance tests to use Forge. Works better, and aligns with horizon and subgraph-service.

Merge these separately to reduce audit branch noise.

Also fixes code coverage to pick Forge coverage.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the @graphprotocol/issuance test suite from the previous Hardhat-based TypeScript setup to Foundry/Forge Solidity tests, and updates coverage generation/collection so Forge lcov output is picked up by CI (consistent with horizon and subgraph-service).

Changes:

  • Remove the packages/issuance/testing and packages/issuance/testing-coverage Hardhat test packages and their TS test suites.
  • Add Forge-based unit tests under packages/issuance/test/unit/** (allocator, direct allocation, eligibility) plus supporting mocks.
  • Update package scripts and CI coverage discovery to generate and upload coverage/lcov.info from forge coverage.

Reviewed changes

Copilot reviewed 60 out of 62 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds forge-std and removes lock entries for the deleted Hardhat testing workspaces.
packages/subgraph-service/package.json Updates Forge coverage script to emit coverage/lcov.info for CI.
packages/horizon/package.json Updates Forge coverage script to emit coverage/lcov.info for CI.
packages/issuance/package.json Switches testing to forge test/forge coverage, adds test:coverage:self lcov output, and adds forge-std.
packages/issuance/foundry.toml Adds forge-std remapping and Foundry lint configuration.
.github/workflows/build-test.yml Expands coverage file discovery to include Forge lcov.info.
packages/contracts/package.json Extends clean script to remove test/node_modules/.
packages/issuance/.solcover.js Removes Hardhat/solidity-coverage configuration (now using Forge coverage).
packages/issuance/test/unit/** (new) Introduces Forge unit tests for allocator, direct allocation, and eligibility modules.
packages/issuance/test/unit/mocks/MockGraphToken.sol (new) Adds an ERC20-based token mock used by Forge tests.
packages/issuance/testing/** (deleted) Removes the Hardhat v3 TS test harness and suites.
packages/issuance/testing-coverage/** (deleted) Removes the Hardhat v2 + solidity-coverage setup.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@openzeppelin-code
Copy link

openzeppelin-code bot commented Feb 27, 2026

Issuance forge migration

Generated at commit: 6f2294988c8288e2c1e558a9661a7c74e8354eec

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
3
5
0
14
37
59
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (fd329b6) to head (6f22949).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
+ Coverage   86.95%   88.50%   +1.54%     
==========================================
  Files          46       75      +29     
  Lines        2492     4611    +2119     
  Branches      746      979     +233     
==========================================
+ Hits         2167     4081    +1914     
- Misses        325      507     +182     
- Partials        0       23      +23     
Flag Coverage Δ
unittests 88.50% <ø> (+1.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Port all allocator, eligibility, and direct-allocation tests from
Hardhat/TypeScript to Forge/Solidity. Tests cover access control,
distribution accounting, target management, defensive checks,
interface compliance, interface ID stability, and operator functions.

Mock contracts placed in test/unit/mocks/ for shared use across
test suites. All 188 tests pass.
Delete testing/ and testing-coverage/ directories, .solcover.js,
and associated workspace packages. Update package scripts to use
forge test/coverage directly. Add forge-std dependency and
forge-lint configuration (exclude mixed-case rules, ignore
node_modules).
Add test:coverage:self scripts that output lcov.info to coverage/
for issuance, horizon, and subgraph-service. Create coverage dir
before running forge coverage (forge does not create it). Update
CI workflow to find both Istanbul JSON and lcov coverage files.
The test/ directories in issuance and contracts were previously pnpm
workspace packages with their own package.json. After removing the
Hardhat test infrastructure, the orphaned test/node_modules remains
locally (pnpm does not clean up node_modules for removed workspace
packages). Add them to the clean scripts so `pnpm clean` removes
them for anyone who still has them.
@RembrandtK RembrandtK force-pushed the issuance-forge-migration branch from 269c94c to 6f22949 Compare February 27, 2026 15:03
@RembrandtK RembrandtK marked this pull request as ready for review February 27, 2026 15:33
@RembrandtK RembrandtK merged commit 6f22949 into main Feb 27, 2026
6 checks passed
@RembrandtK RembrandtK deleted the issuance-forge-migration branch February 27, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants