test: replace legacy changeset usage with new#110
Conversation
ee9edce to
6b95819
Compare
0848548 to
641037d
Compare
6b95819 to
3403a97
Compare
Release impact (release-please)
PR title: This title will not trigger a semver bump when squash-merged to Conventional commit → bump
Update the PR title before merge if you need a different bump (squash commit message = PR title). Preview is based on this PR title only. The release-please release PR may include other unreleased commits already on |
There was a problem hiding this comment.
Pull request overview
Updates MCMS integration/unit tests to stop relying on legacy MCMS changesets (notably the legacy deploy changeset) and instead exercise the new MCMS deploy + related changesets/registrations for both EVM and Solana paths.
Changes:
- Migrate Solana/EVM tests from
legacy/mcms/changesetsdeploy/transfer usage tomcms/changesets/deploy(+transfer-to-timelockwhere applicable). - Introduce Solana test helpers to (a) reuse cached MCMS program artifacts and (b) seed a datastore with canonical Solana MCMS program IDs for the new deploy changeset.
- Convert several EVM set-config tests to black-box (
*_test) package usage and validate via the exported registration/sequence/operation APIs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| mcms/solana/set-config/sequence_test.go | Switch Solana set-config test runtime bootstrap to new deploy changeset + seeded datastore. |
| mcms/solana/firedrill/changeset_test.go | Switch Solana firedrill runtime bootstrap to new deploy changeset + seeded datastore. |
| mcms/solana/deploy/changeset_test.go | Reuse shared Solana datastore seeding helper instead of inline datastore setup. |
| mcms/evm/set-config/validate_test.go | Move to external test package; validate via Registration().Verify with proper chain context. |
| mcms/evm/set-config/sequence_test.go | Replace legacy deploy/transfer tests with new changesets and sequence execution via registry. |
| mcms/evm/set-config/register_test.go | Validate EVM registration through exported registration and registry lookups. |
| mcms/evm/set-config/operation_test.go | Update operation tests to call exported operation/types from the package. |
| mcms/evm/firedrill/changeset_test.go | Switch EVM firedrill runtime bootstrap to new deploy changeset. |
| mcms/changesets/set-config/helpers_test.go | Update shared test helpers to use new deploy + transfer-to-timelock changesets; add EVM ref loading via readers. |
| mcms/changesets/set-config/changeset_test.go | Update EVM MCMS address/ref loading and qualifier tests to use new deploy + readers-based lookup. |
| legacy/pkg/family/solana/testutils/preload.go | Add LoadMCMSPrograms helper to reuse cached MCMS Solana program artifacts. |
| internal/testutil/solanatest/datastore.go | Add helper to seed datastore with canonical Solana MCMS program IDs for tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3403a97 to
40cc742
Compare
Replace legacy changeset usage in the new changeset tests , spefiically the deploy mcms legacy changeset, now they use the new deploy changeset for mcms
40cc742 to
408938d
Compare
| // MaybeLoadMCMSWithTimelockState loads MCMSWithTimelockState for each provided chain selector from the environment. | ||
| func MaybeLoadMCMSWithTimelockState(env cldf.Environment, chainSelectors []uint64) (map[uint64]*MCMSWithTimelockState, error) { | ||
| result := map[uint64]*MCMSWithTimelockState{} | ||
| solChains := env.BlockChains.SolanaChains() | ||
| for _, chainSelector := range chainSelectors { | ||
| chain, ok := solChains[chainSelector] | ||
| if !ok { | ||
| return nil, fmt.Errorf("chain %d not found", chainSelector) | ||
| } | ||
| addressesChain, err := env.ExistingAddresses.AddressesForChain(chainSelector) //nolint:staticcheck // SA1019: AddressBook deprecated; Solana MCMS load merges with address book until full DataStore migration. | ||
| if err != nil { | ||
| if !errors.Is(err, cldf.ErrChainNotFound) { | ||
| return nil, fmt.Errorf("unable to get addresses for chain %v: %w", chainSelector, err) | ||
| } | ||
| // chain not found in address book, initialize empty | ||
| addressesChain = make(map[string]cldf.TypeAndVersion) | ||
| } | ||
| state, err := MaybeLoadMCMSWithTimelockChainState(chain, addressesChain) | ||
| state, err := GetState(env, chainSelector) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("unable to load mcms and timelock solana chain state: %w", err) | ||
| return nil, fmt.Errorf("unable to load mcms and timelock solana chain state for chain %d: %w", chainSelector, err) | ||
| } | ||
| result[chainSelector] = state |
Replace legacy changeset usage in the new changeset tests , spefiically the deploy mcms legacy changeset, now they use the new deploy changeset for mcms. This was done initially to get things going before the deploy changesets were ready.