-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add network type helpers to BlockChain interface #695
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
Conversation
🦋 Changeset detectedLatest commit: f029584 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
👋 jkongie, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
a1a6715 to
b5d39f9
Compare
This adds the `NetworkType` and `IsNetworkType` helpers to the BlockChain interface, and updates all implementations to adhere to the updated interface.
b5d39f9 to
f029584
Compare
|
graham-chainlink
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // IsNetworkType checks if the chain is on the given network type | ||
| func (c ChainMetadata) IsNetworkType(networkType chainsel.NetworkType) bool { | ||
| // Get the network type of the chain | ||
| t, err := c.NetworkType() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud if we need to return err instead of assuming it is false. Looking at the code , the error we get is unknown chain selector , in that case, i guess it is fair to return false for all network type.
Looks good then!
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Minor Changes - [#695](#695) [`36b8a3d`](36b8a3d) Thanks [@jkongie](https://github.com/jkongie)! - Adds methods to determine the network type of a Chain - `chain.NetworkType()` - Returns the network type determined by delegating to the `chain-selectors` package - `chain.IsNetworkType(chainsel.NetworkTypeMainnet)` - Returns a boolean if the network type matches ### Patch Changes - [#694](#694) [`b00e038`](b00e038) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - fix(engine/test): support multiple mcms deployments Fix MCMS test helpers to support multiple deployments on same chain This resolves an issue where MCMS test helpers failed when multiple MCMS instances were deployed on the same chain, causing "multiple CallProxy addresses found in datastore" errors. --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>




This adds the
NetworkTypeandIsNetworkTypehelpers to the BlockChain interface, and updates all implementations to adhere to the updated interface.