Skip to content

refactor(mcms): split chain helpers#921

Closed
ajaskolski wants to merge 2 commits intomainfrom
refactor-split-chain-helpers-mcms
Closed

refactor(mcms): split chain helpers#921
ajaskolski wants to merge 2 commits intomainfrom
refactor-split-chain-helpers-mcms

Conversation

@ajaskolski
Copy link
Copy Markdown
Contributor

@ajaskolski ajaskolski commented Apr 9, 2026

We split the big chain_helpers.go into per-chain files so Aptos/Sui tweaks and the like have an obvious home, while the main file just does the shared “figure out family and dispatch” stuff. Behavior should be the same—same chainwrappers calls and default fallback—just easier to find and edit.

https://smartcontract-it.atlassian.net/browse/CLD-1183

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: 118759b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ajaskolski ajaskolski force-pushed the refactor-split-chain-helpers-mcms branch 2 times, most recently from b80cb68 to 34ab99c Compare April 9, 2026 11:28
@ajaskolski ajaskolski force-pushed the refactor-split-chain-helpers-mcms branch from 34ab99c to 70c631a Compare April 9, 2026 11:36
@ajaskolski ajaskolski marked this pull request as ready for review April 9, 2026 11:44
@ajaskolski ajaskolski requested a review from a team as a code owner April 9, 2026 11:44
Copilot AI review requested due to automatic review settings April 9, 2026 11:44
Copy link
Copy Markdown
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

Refactors the MCMS fork execution helpers by splitting chain-specific inspector/executor construction into per-chain files and keeping chain_helpers.go focused on shared selector-family dispatch. This aims to keep behavior consistent while making per-chain tweaks (Aptos/Sui/etc.) easier to locate and extend.

Changes:

  • Added selector-family detection and dispatch for inspector/executor/timelock-executor creation.
  • Introduced per-chain helper files (EVM/Solana/Aptos/Sui/Ton) for chain-specific construction/validation hooks.
  • Added unit tests covering selector family lookup and several error paths.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
engine/cld/commands/mcms/chain_helpers.go Adds selector-family dispatch and shared helper functions (newChainAccessor, selectorFamily).
engine/cld/commands/mcms/chain_helpers_evm.go EVM-specific builder wrappers (currently passthrough to chainwrappers).
engine/cld/commands/mcms/chain_helpers_solana.go Solana-specific builder wrappers (currently passthrough to chainwrappers).
engine/cld/commands/mcms/chain_helpers_aptos.go Aptos builders with action→role validation hook before delegating to chainwrappers.
engine/cld/commands/mcms/chain_helpers_sui.go Sui builders with metadata parsing/validation hook before delegating to chainwrappers.
engine/cld/commands/mcms/chain_helpers_ton.go Ton-specific builder wrappers (currently passthrough to chainwrappers).
engine/cld/commands/mcms/chain_helpers_test.go Adds unit tests for selector-family and error-path behavior.

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

ecPablo
ecPablo previously approved these changes Apr 9, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
73.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@ajaskolski ajaskolski closed this Apr 9, 2026
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