Skip to content

Commit

Permalink
Slightly simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Nov 22, 2024
1 parent 39c17b8 commit 52f12d2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions deployment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,24 +363,26 @@ func NodeInfo(nodeIDs []string, oc NodeChainConfigsLister) (Nodes, error) {
KeyBundleID: chainConfig.Ocr2Config.OcrKeyBundle.BundleId,
}

var details chain_selectors.ChainDetails
if chainConfig.Chain.Type == nodev1.ChainType_CHAIN_TYPE_EVM {
// NOTE: Assume same adminAddr for all chains. We always use EVM addr
adminAddr = chainConfig.AdminAddress
}

var family string
switch chainConfig.Chain.Type {
case nodev1.ChainType_CHAIN_TYPE_APTOS:
details, err = chain_selectors.GetChainDetailsByChainIDAndFamily(chainConfig.Chain.Id, chain_selectors.FamilyAptos)
if err != nil {
return nil, err
}
family = chain_selectors.FamilyAptos
case nodev1.ChainType_CHAIN_TYPE_EVM:
// NOTE: Assume same adminAddr for all chains. We always use EVM addr
adminAddr = chainConfig.AdminAddress
details, err = chain_selectors.GetChainDetailsByChainIDAndFamily(chainConfig.Chain.Id, chain_selectors.FamilyEVM)
if err != nil {
return nil, err
}
family = chain_selectors.FamilyEVM
default:
return nil, fmt.Errorf("unsupported chain type %s", chainConfig.Chain.Type)
}

details, err := chain_selectors.GetChainDetailsByChainIDAndFamily(chainConfig.Chain.Id, family)
if err != nil {
return nil, err
}

selToOCRConfig[details] = ocrConfig
}
nodes = append(nodes, Node{
Expand Down

0 comments on commit 52f12d2

Please sign in to comment.