Skip to content

Commit

Permalink
Merge branch 'main' into generalize-and-deduplicate-selectors-code
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaveracll authored Nov 21, 2024
2 parents c66e7fb + 502f846 commit a28c621
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func EvmChainIdToChainSelector() map[uint64]uint64 {
return copyMap
}

// Deprecated, this only supports EVM chains, use the chain agnostic `GetChainIDFromSelector` instead
func ChainIdFromSelector(chainSelectorId uint64) (uint64, error) {
for k, v := range evmChainIdToChainSelector {
if v.ChainSelector == chainSelectorId {
Expand All @@ -78,13 +79,15 @@ func ChainIdFromSelector(chainSelectorId uint64) (uint64, error) {
return 0, fmt.Errorf("chain not found for chain selector %d", chainSelectorId)
}

// Deprecated, this only supports EVM chains, use the chain agnostic `GetChainDetailsByChainIDAndFamily` instead
func SelectorFromChainId(chainId uint64) (uint64, error) {
if chainSelectorId, exist := evmChainIdToChainSelector[chainId]; exist {
return chainSelectorId.ChainSelector, nil
}
return 0, fmt.Errorf("chain selector not found for chain %d", chainId)
}

// Deprecated, this only supports EVM chains, use the chain agnostic `NameFromChainId` instead
func NameFromChainId(chainId uint64) (string, error) {
details, exist := evmChainIdToChainSelector[chainId]
if !exist {
Expand Down

0 comments on commit a28c621

Please sign in to comment.