From 499486913f0a4d92cfdf36410c32f95f358b3a34 Mon Sep 17 00:00:00 2001 From: kachapah <60323455+Sidu28@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:41:24 -0800 Subject: [PATCH] added tx.Send --- chainio/clients/avsregistry/writer.go | 29 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/chainio/clients/avsregistry/writer.go b/chainio/clients/avsregistry/writer.go index d60d1a24..0ed54a7d 100644 --- a/chainio/clients/avsregistry/writer.go +++ b/chainio/clients/avsregistry/writer.go @@ -455,12 +455,6 @@ func (w *ChainWriter) RegisterOperatorWithChurn( Expiry: signatureExpiry, } - ///////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////// - var operatorKickParams []regcoord.ISlashingRegistryCoordinatorTypesOperatorKickParam for i, operatorToKick := range operatorsToKick { operatorKickParams = append(operatorKickParams, regcoord.ISlashingRegistryCoordinatorTypesOperatorKickParam{ @@ -508,7 +502,7 @@ func (w *ChainWriter) RegisterOperatorWithChurn( return nil, err } - w.registryCoordinator.RegisterOperatorWithChurn( + tx, err := w.registryCoordinator.RegisterOperatorWithChurn( noSendTxOpts, quorumNumbers.UnderlyingType(), socket, @@ -517,8 +511,25 @@ func (w *ChainWriter) RegisterOperatorWithChurn( operatorSignatureWithSaltAndExpiry, churnApproverSignatureWithSaltAndExpiry, ) - - return nil, nil + if err != nil { + return nil, err + } + receipt, err := w.txMgr.Send(ctx, tx, waitForReceipt) + if err != nil { + return nil, utils.WrapError("failed to send tx with err", err.Error()) + } + w.logger.Info( + "successfully registered operator with AVS registry coordinator", + "txHash", + receipt.TxHash.String(), + "avs-service-manager", + w.serviceManagerAddr, + "operator", + operatorAddr, + "quorumNumbers", + quorumNumbers, + ) + return receipt, nil } // Updates the stakes of a the given `operators` for all the quorums.