Skip to content

Commit

Permalink
chore: remove duplicated function
Browse files Browse the repository at this point in the history
`ForceDeregisterFromOperatorSets` does the same as `DeregisterFromOperatorSets`, so we can simply remove it.
  • Loading branch information
MegaRedHand committed Jan 7, 2025
1 parent a0cf13a commit 6dbf073
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions chainio/clients/elcontracts/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,43 +452,6 @@ func (w *ChainWriter) ProcessClaims(
return receipt, nil
}

func (w *ChainWriter) ForceDeregisterFromOperatorSets(
ctx context.Context,
operator gethcommon.Address,
avs gethcommon.Address,
operatorSetIds []uint32,
waitForReceipt bool,
) (*gethtypes.Receipt, error) {
if w.allocationManager == nil {
return nil, errors.New("AVSDirectory contract not provided")
}

noSendTxOpts, err := w.txMgr.GetNoSendTxOpts()
if err != nil {
return nil, utils.WrapError("failed to get no send tx opts", err)
}

tx, err := w.allocationManager.DeregisterFromOperatorSets(
noSendTxOpts,
allocationmanager.IAllocationManagerTypesDeregisterParams{
Operator: operator,
Avs: avs,
OperatorSetIds: operatorSetIds,
},
)

if err != nil {
return nil, utils.WrapError("failed to create ForceDeregisterFromOperatorSets tx", err)
}

receipt, err := w.txMgr.Send(ctx, tx, waitForReceipt)
if err != nil {
return nil, utils.WrapError("failed to send tx", err)
}

return receipt, nil
}

func (w *ChainWriter) ModifyAllocations(
ctx context.Context,
operatorAddress gethcommon.Address,
Expand Down

0 comments on commit 6dbf073

Please sign in to comment.