Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions deployment/deploy/transfer_ownership.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,15 @@ func acceptOwnershipApply(cr *TransferOwnershipAdapterRegistry, mcmsRegistry *ch
if err != nil {
return cldf.ChangesetOutput{}, err
}
// if partial refs are provided, resolve to full refs
for i, contractRef := range perChainInputs.ContractRef {
normRef, err := TryNormalizeAddressRef(perChainInputs.ChainSelector, contractRef)
addrRef, err := TryNormalizeAddressRef(perChainInputs.ChainSelector, contractRef)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to normalize contract ref %s for chain %d: %w", datastore_utils.SprintRef(contractRef), perChainInputs.ChainSelector, err)
}
fullRef, err := datastore_utils.FindAndFormatRef(e.DataStore, normRef, perChainInputs.ChainSelector, datastore_utils.FullRef)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve contract ref %s for chain %d: %w", datastore_utils.SprintRef(normRef), perChainInputs.ChainSelector, err)
if fullRef, err := datastore_utils.FindAndFormatRef(e.DataStore, addrRef, perChainInputs.ChainSelector, datastore_utils.FullRef); err == nil {
addrRef = fullRef
}
Comment thread
chris-de-leon-cll marked this conversation as resolved.
Outdated
perChainInputs.ContractRef[i] = fullRef
perChainInputs.ContractRef[i] = addrRef
Comment thread
chris-de-leon-cll marked this conversation as resolved.
Outdated
}
report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, adapter.SequenceAcceptOwnership(), e.BlockChains, perChainInputs)
if err != nil {
Expand Down Expand Up @@ -90,17 +88,15 @@ func transferOwnershipApply(cr *TransferOwnershipAdapterRegistry, mcmsRegistry *
if err != nil {
return cldf.ChangesetOutput{}, err
}
// if partial refs are provided, resolve to full refs
for i, contractRef := range perChainInputs.ContractRef {
normRef, err := TryNormalizeAddressRef(perChainInputs.ChainSelector, contractRef)
addrRef, err := TryNormalizeAddressRef(perChainInputs.ChainSelector, contractRef)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to normalize contract ref %s for chain %d: %w", datastore_utils.SprintRef(contractRef), perChainInputs.ChainSelector, err)
}
fullRef, err := datastore_utils.FindAndFormatRef(e.DataStore, normRef, perChainInputs.ChainSelector, datastore_utils.FullRef)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to resolve contract ref %s for chain %d: %w", datastore_utils.SprintRef(normRef), perChainInputs.ChainSelector, err)
if fullRef, err := datastore_utils.FindAndFormatRef(e.DataStore, addrRef, perChainInputs.ChainSelector, datastore_utils.FullRef); err == nil {
addrRef = fullRef
}
perChainInputs.ContractRef[i] = fullRef
perChainInputs.ContractRef[i] = addrRef
Comment thread
chris-de-leon-cll marked this conversation as resolved.
Outdated
}
chainBatchOps, chainReports, err := transferAndAcceptOwnership(e, adapter, perChainInputs, input.MCMS)
if err != nil {
Expand Down
Loading