Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mcms/solana): update helpers to support solana #16276

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

graham-chainlink
Copy link
Collaborator

The MCMS proposal helpers currently only support EVM, this commit update it to support the solana chain.

JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1361

The MCMS proposal helpers currently only support EVM, this commit update it to support the solana chain.

JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1361
Copy link
Contributor

@ajaskolski ajaskolski left a comment

Choose a reason for hiding this comment

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

lgtm

_, err = chain.Confirm(evmTransaction)
require.NoError(t, err)
// no need to confirm transaction on solana as the MCMS sdk confirms it internally
if family == chainsel.FamilyEVM {

Choose a reason for hiding this comment

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

if you consider future chains, it's probably safer to do family != chainsel.FamilySolana. But, since this is a test helper, I'd also consider (unnecessarily) calling Confirm on Solana, if there are no side-effects. Just to make it easier to maintain the code.

Copy link
Collaborator Author

@graham-chainlink graham-chainlink Feb 10, 2025

Choose a reason for hiding this comment

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

if you consider future chains, it's probably safer to do family != chainsel.FamilySolana.

I feel like if we introduce any future changes , the switch statement at the top will have to be updated, so we have to come back to this function regardless and i cant be sure other chains require confirmation or not, it is more of an assumption at this point?

I'd also consider (unnecessarily) calling Confirm on Solana, if there are no side-effects.

True, the reason i didn do it is because i will be adding more branches/switch since the chain.Confirm is a different struct for solana compare to evm , so maintenance will involve another branch of code, not necessarily easier?

eg a new branch

		if family == chainsel.FamilyEVM {
			chain := env.Chains[sel]
			evmTransaction := tx.RawTransaction.(*gethtypes.Transaction)
			_, err = chain.Confirm(evmTransaction)
			require.NoError(t, err)
		}
		if family == chainsel.FamilySolana {
			chain := env.SolChains[sel]
			solTransaction := tx.RawTransaction.(*solana.Transaction)
			_ = chain.Confirm(solTransaction)
		}

merging first since the queue is quiet, happy to open a PR to address any other issue

@graham-chainlink graham-chainlink added this pull request to the merge queue Feb 10, 2025
@graham-chainlink graham-chainlink removed this pull request from the merge queue due to a manual request Feb 10, 2025
@graham-chainlink graham-chainlink added this pull request to the merge queue Feb 10, 2025
Merged via the queue into develop with commit 03d085b Feb 10, 2025
186 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/DPA-1361/update-helpers-solana branch February 10, 2025 07:26
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.

4 participants