Skip to content

Conversation

@ecPablo
Copy link
Contributor

@ecPablo ecPablo commented Jan 15, 2026

In order to be able to abstract away inspectors and timelock converter builders into mcms lib, we've defined a set of new interfaces for chain access that allow mcmslib to access the blockchain without directly depending on CLDF. This PR create the adapter for CLDF chains to comply with the mcms lib interfaces, which will be used in mcms-tools and several of the CLD composite Go Actions related to mcms.

AI Summary

This pull request introduces a new adapter, ChainAccess, to the mcms package, providing a unified interface for accessing multiple blockchain clients (EVM, Solana, Aptos, Sui) via chain selectors. It also adds comprehensive unit tests to ensure correct behavior for both known and unknown selectors.

New adapter implementation:

  • Added chain/adapters/mcms/chain_access.go, which implements the ChainAccess struct to adapt CLDF's BlockChains into a selector-based lookup API, supporting EVM, Solana, Aptos, and Sui clients.

Testing:

  • Added chain/adapters/mcms/chain_access_test.go with tests for handling unknown selectors and verifying correct client/signature retrieval for each supported chain type.

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: 4d310b3

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


// ChainAccess adapts CLDF's chain.BlockChains into a selector + lookup style API.
// It used to make compatible with mcms lib chain access interface.
type ChainAccess struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Personally I would prefer to call this an Adapter in the name to make it clear what it is doing.

So if ChainAccess is the name of the interface you are adapting to then ChainAccessAdapter

@@ -0,0 +1,67 @@
package mcms
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should flip this around and make this chains/mcms/adapter with the package name adapter

The mcms package name is kinda overloaded now

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.

2 participants