Skip to content

Commit

Permalink
Simplify a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Dec 10, 2024
1 parent ecf4c66 commit f0c8ba8
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions deployment/ccip/changeset/cs_home_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,41 +386,39 @@ func RemoveDONs(e deployment.Environment, cfg RemoveDONsConfig) (deployment.Chan
if err != nil {
return deployment.ChangesetOutput{}, err
}
if cfg.MCMS != nil {
p, err := proposalutils.BuildProposalFromBatches(
map[uint64]common.Address{
cfg.HomeChainSel: homeChainState.Timelock.Address(),
},
map[uint64]*gethwrappers.ManyChainMultiSig{
cfg.HomeChainSel: homeChainState.ProposerMcm,
},
[]timelock.BatchChainOperation{
{
ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSel),
Batch: []mcms.Operation{
{
To: homeChainState.CapabilityRegistry.Address(),
Data: tx.Data(),
Value: big.NewInt(0),
},
},
},
},
"Remove DONs",
cfg.MCMS.MinDelay,
)
if err != nil {
return deployment.ChangesetOutput{}, err
}
return deployment.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{
*p,
}}, nil
} else {
_, err := homeChain.Confirm(tx)
if cfg.MCMS == nil {
_, err = homeChain.Confirm(tx)
if err != nil {
return deployment.ChangesetOutput{}, err
}
return deployment.ChangesetOutput{}, nil
}
p, err := proposalutils.BuildProposalFromBatches(
map[uint64]common.Address{
cfg.HomeChainSel: homeChainState.Timelock.Address(),
},
map[uint64]*gethwrappers.ManyChainMultiSig{
cfg.HomeChainSel: homeChainState.ProposerMcm,
},
[]timelock.BatchChainOperation{
{
ChainIdentifier: mcms.ChainIdentifier(cfg.HomeChainSel),
Batch: []mcms.Operation{
{
To: homeChainState.CapabilityRegistry.Address(),
Data: tx.Data(),
Value: big.NewInt(0),
},
},
},
},
"Remove DONs",
cfg.MCMS.MinDelay,
)
if err != nil {
return deployment.ChangesetOutput{}, err
}
// Remove all DONs
return deployment.ChangesetOutput{}, nil
return deployment.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{
*p,
}}, nil
}

0 comments on commit f0c8ba8

Please sign in to comment.