Skip to content

Commit

Permalink
CCIP cap jobs running
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Aug 13, 2024
1 parent ba612fd commit c9f4cce
Show file tree
Hide file tree
Showing 4 changed files with 403 additions and 68 deletions.
66 changes: 0 additions & 66 deletions integration-tests/deployment/ccip/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ var (
EVM2EVMMultiOffRamp_1_6_0 = "EVM2EVMMultiOffRamp 1.6.0-dev"
NonceManager_1_6_0 = "NonceManager 1.6.0-dev"
PriceRegistry_1_6_0 = "PriceRegistry 1.6.0-dev"

CapabilityLabelledName = "ccip"
CapabilityVersion = "v1.0.0"
)

type Contracts interface {
Expand Down Expand Up @@ -111,69 +108,6 @@ type DeployCCIPContractConfig struct {
CCIPOnChainState
}

func DeployCapReg(lggr logger.Logger, chains map[uint64]deployment.Chain, chainSel uint64) (deployment.AddressBook, error) {
ab := deployment.NewMemoryAddressBook()
chain := chains[chainSel]
capReg, err := deployContract(lggr, chain, ab,
func(chain deployment.Chain) ContractDeploy[*capabilities_registry.CapabilitiesRegistry] {
crAddr, tx, cr, err2 := capabilities_registry.DeployCapabilitiesRegistry(
chain.DeployerKey,
chain.Client,
)
return ContractDeploy[*capabilities_registry.CapabilitiesRegistry]{
Address: crAddr, Contract: cr, TvStr: CapabilitiesRegistry_1_0_0, Tx: tx, Err: err2,
}
})
if err != nil {
lggr.Errorw("Failed to deploy capreg", "err", err)
return ab, err
}
lggr.Infow("deployed capreg", "addr", capReg.Address)
ccipConfig, err := deployContract(
lggr, chain, ab,
func(chain deployment.Chain) ContractDeploy[*ccip_config.CCIPConfig] {
ccAddr, tx, cc, err2 := ccip_config.DeployCCIPConfig(
chain.DeployerKey,
chain.Client,
capReg.Address,
)
return ContractDeploy[*ccip_config.CCIPConfig]{
Address: ccAddr, TvStr: CCIPConfig_1_6_0, Tx: tx, Err: err2, Contract: cc,
}
})
if err != nil {
lggr.Errorw("Failed to deploy ccip config", "err", err)
return ab, err
}
lggr.Infow("deployed ccip config", "addr", ccipConfig.Address)

_, err = capReg.Contract.AddCapabilities(chain.DeployerKey, []capabilities_registry.CapabilitiesRegistryCapability{
{
LabelledName: CapabilityLabelledName,
Version: CapabilityVersion,
CapabilityType: 2, // consensus. not used (?)
ResponseType: 0, // report. not used (?)
ConfigurationContract: ccipConfig.Address,
},
})
if err != nil {
lggr.Errorw("Failed to add capabilities", "err", err)
return ab, err
}
// TODO: Just one for testing.
_, err = capReg.Contract.AddNodeOperators(chain.DeployerKey, []capabilities_registry.CapabilitiesRegistryNodeOperator{
{
Admin: chain.DeployerKey.From,
Name: "NodeOperator",
},
})
if err != nil {
lggr.Errorw("Failed to add node operators", "err", err)
return ab, err
}
return ab, nil
}

// TODO: Likely we'll want to further parameterize the deployment
// For example a list of contracts to skip deploying if they already exist.
// Or mock vs real RMN.
Expand Down
Loading

0 comments on commit c9f4cce

Please sign in to comment.