Skip to content

Conversation

@graham-chainlink
Copy link
Collaborator

Maps JD proto ChainType to the chain selector family string.

This is useful when users are using JD client received a response for node chain config where the type is a JD proto ChainType which is an integer , to make it useful, users would have to perform the conversion themselves. Seems to make sense to have it in a single place for this mapping logic.

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: 2762ba0

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

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework 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

Maps JD proto ChainType to the chain selector family string.

This is useful when users are using JD client received a response for node chain config where the type is a JD proto ChainType which is an integer , to make it useful, users would have to perform the [conversion themselves. ](https://github.com/smartcontractkit/chainlink/blob/0f6fe00217300ef6f8543abb40e6acc367c64c82/deployment/common/view/nops.go#L376-L394) Seems to make sense to have it in a single place for this mapping logic.
@graham-chainlink graham-chainlink changed the title feat(jd): new mapper function for chain family feat(jd): new converter function for chain family Dec 31, 2025
@cl-sonarqube-production
Copy link

@graham-chainlink graham-chainlink marked this pull request as ready for review December 31, 2025 00:57
@graham-chainlink graham-chainlink requested a review from a team as a code owner December 31, 2025 00:57
Copilot AI review requested due to automatic review settings December 31, 2025 00:57
Copy link
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

This PR introduces a utility function ChainTypeToFamily that converts JD proto ChainType enum values to chain selector family strings, eliminating the need for users to perform this conversion manually in multiple places.

  • Adds ChainTypeToFamily converter function with comprehensive error handling
  • Includes test coverage for all supported chain types and error cases
  • Adds changeset documenting the new feature

Reviewed changes

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

File Description
offchain/jd/chain_type.go Implements the ChainTypeToFamily converter function with switch-case mapping for all supported chain types
offchain/jd/chain_type_test.go Provides comprehensive test coverage for all chain types including error cases
.changeset/sour-knives-join.md Documents the new feature for release notes

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

"chainlink-deployments-framework": minor
---

feat(jd): new mapper function for chain family
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

Corrected terminology from 'mapper' to 'converter' to match the PR title and description.

Suggested change
feat(jd): new mapper function for chain family
feat(jd): new converter function for chain family

Copilot uses AI. Check for mistakes.
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