Skip to content

fix: bind mock reencryption and decryption contracts to provider - #35

Open
Kewe63 wants to merge 1 commit into
Inco-fhevm:mainfrom
Kewe63:fix/mock-contract-runners
Open

Kewe63 wants to merge 1 commit into
Inco-fhevm:mainfrom
Kewe63:fix/mock-contract-runners

Conversation

@Kewe63

@Kewe63 Kewe63 commented Sep 17, 2026

Copy link
Copy Markdown

Summary

Fixes #34.

  • Connect the generated ACL contracts to the active Hardhat provider in the mock reencryption and asynchronous decryption helpers.
  • Connect the generated gateway contract to the same provider for calls and subscriptions; keep the explicit relayer connection for fulfillment transactions.
  • Add a mock-only regression covering an owner's authorized balance view, with an independent control checking the minted value and both ACL grants.

No Solidity contracts, authorization rules, package versions, lockfile, or network configuration are changed.

Verification

Environment: Node 20.19.0, pnpm 9.15.9, Hardhat 2.22.8, ethers 6.13.2, fhevm 0.5.8 and fhevmjs 0.5.2. Tests ran with the public .env.example configuration and --network hardhat inside a network namespace; no live network was used.

  • Regression check with the three provider bindings temporarily removed: 1 passing, 3 failing, all three failures reporting contract runner does not support calling.
  • Restore the fix and run pnpm test:mock --grep 'Quality authorized view|ConfidentialERC20Wrapper': 4 passing, including wrap and asynchronous unwrap.
  • Full pnpm test:mock: 12 passing, 2 failing. The remaining two compliance tests now reach the ACL check and fail with User is not authorized to reencrypt this handle!; this exposes the separate sender-balance contract ACL issue already addressed by open PR fix: grant contract ACL permission on sender's new balance in CompliantConfidentialERC20._transfer #32. It is deliberately not included in this helper-only change.
  • ESLint and Prettier checks on all three changed files: passed.
  • git diff --cached --check: passed.

Existing limitations

  • Repository-wide pnpm lint:tsc still reports the existing coprocessorUtils.ts errors and undeclared web3-validator type resolution. No new diagnostic appears in the added test or provider-binding changes.
  • The aggregate lint check after mock setup encounters existing formatting differences in generated fhevmTemp files; those generated files are not part of this PR.
  • Real FHEVM/Rivest and the coverage job were not run. The regression is intentionally skipped outside the Hardhat mock network, and its debug decryption control is not a production decryption claim.

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.

Mock reencryption and decryption helpers create TypeChain contracts without a runner

1 participant