Skip to content

Conversation

@ecPablo
Copy link
Collaborator

@ecPablo ecPablo commented Jan 16, 2026

This pull request introduces a new method for querying the current operation count from the on-chain MCMS contract, along with supporting infrastructure to facilitate testing. The changes include the addition of the GetOpCount method to the TimelockProposal struct, a testable factory for building chain inspectors, and comprehensive unit tests for the new method.

New functionality and testability:

  • Added the GetOpCount method to TimelockProposal, allowing retrieval of the current operation count from the on-chain MCMS contract for a given chain selector. This method uses a factory to build the appropriate chain inspector and supports error handling for missing metadata and factory errors.
  • Introduced a testable inspectorFactory variable and its supporting types, enabling injection of mock inspectors during testing and simplifying test setup for different chain families.

Testing improvements:

  • Added the TestTimelockProposal_GetOpCount unit test, which covers successful retrieval, missing metadata, and factory error cases, and demonstrates the use of the overrideable inspector factory for cleaner, more robust tests.

Dependency and import updates:

  • Updated imports in both timelock_proposal.go and timelock_proposal_test.go to include the new chainaccess package and reorganized mock imports for clarity and correctness. [1] [2]

Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: f9c4c45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartcontractkit/mcms Minor

Not sure what this means? Click here to learn what changesets are.

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

Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
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.

1 participant