PR U: NotaryRegistry E2E round-trip via ganache CLI + in-process solc #25
Reference in New Issue
Block a user
Delete Branch "devin/1776891791-pr-u-notary-e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a headless end-to-end round-trip that spawns the ganache CLI as a child process, deploys
NotaryRegistry.solvia in-processsolc-jscompilation, and exercisesservices/notaryChain.ts(anchorPlan+finalizeAnchor) against the real chain via ethers v6.Closes gap-analysis v3 §7.9 / §8.5 — PR Q’s existing E2E covered Postgres only; this one covers the chain adapter boundary the orchestrator actually depends on.
Changes
contracts/NotaryRegistry.sol— add OZ v5constructor(address initialOwner) Ownable(initialOwner) {}(required by OpenZeppelin v5; contract was written for v4 and would not compile otherwise).orchestrator/src/services/notaryChain.ts:(uint8, address, uint256, bytes)— butIComboHandler.Stepis(uint8, bytes, address, uint256). Different tuple order → different canonical signature → different function selector → every on-chain call silently reverted with no revert data. Corrected to match.cacheTimeout: -1) so back-to-back anchor+finalize on fast chains no longer read a stalegetTransactionCountand collide on nonce.orchestrator/tests/e2e/helpers/compileNotaryRegistry.ts— in-processsolc-jscompilation with recursive import resolver (handles./interfaces/*.sol+@openzeppelin/contracts/...), returns{ abi, bytecode }ready forContractFactory. Avoids any hardhat dependency.orchestrator/tests/e2e/notaryChainRoundtrip.e2e.test.ts— gated onRUN_E2E=1; 3 tests:anchorPlanwrites aPlanRegisteredrecord on-chain (verified viaplans(bytes32)read).finalizeAnchorwrites aPlanFinalizedrecord, emits the matching receipt hash.anchorPlanfalls back tomode: mockcleanly when envs are unset.orchestrator/package.json— addsganache@7.9.2,solc@0.8.20to devDependencies.Verification
npx tsc --noEmitclean.npx jestunit suite: 10 suites / 128 tests — unchanged, all passing.RUN_E2E=1 npx jest --config=jest.e2e.config.js tests/e2e/notaryChainRoundtrip.e2e.test.ts: 3 / 3 passing.Notes
anchorPlanis preserved — production deployments without chain envs degrade gracefully.registerPlan— PR E’s SWIFT step IDs will land that separately.