diff --git a/chainio/clients/elcontracts/writer.go b/chainio/clients/elcontracts/writer.go index 478a19c2..08b05269 100644 --- a/chainio/clients/elcontracts/writer.go +++ b/chainio/clients/elcontracts/writer.go @@ -198,6 +198,10 @@ func (w *ChainWriter) UpdateOperatorDetails( return nil, errors.New("DelegationManager contract not provided") } + if w.allocationManager == nil { + return nil, errors.New("AlocationManager contract not provided") + } + w.logger.Infof("updating operator details of operator %s to EigenLayer", operator.Address) noSendTxOpts, err := w.txMgr.GetNoSendTxOpts() @@ -208,14 +212,22 @@ func (w *ChainWriter) UpdateOperatorDetails( operatorAddress := gethcommon.HexToAddress(operator.Address) delegationApprover := gethcommon.HexToAddress(operator.DelegationApproverAddress) + println(operator.Address) + println(operator.DelegationApproverAddress) + tx, err := w.delegationManager.ModifyOperatorDetails(noSendTxOpts, operatorAddress, delegationApprover) if err != nil { return nil, err } + + println("HERE") receipt, err := w.txMgr.Send(ctx, tx, waitForReceipt) if err != nil { return nil, errors.New("failed to send tx with err: " + err.Error()) } + + println("HERE") + w.logger.Info( "successfully updated operator details", "txHash", diff --git a/chainio/clients/elcontracts/writer_test.go b/chainio/clients/elcontracts/writer_test.go index 955381de..7aca9d38 100644 --- a/chainio/clients/elcontracts/writer_test.go +++ b/chainio/clients/elcontracts/writer_test.go @@ -117,7 +117,7 @@ func TestChainWriter(t *testing.T) { walletModifiedAddress := crypto.PubkeyToAddress(walletModified.PublicKey) operatorModified := types.Operator{ - Address: walletModifiedAddress.Hex(), + Address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", DelegationApproverAddress: walletModifiedAddress.Hex(), AllocationDelay: 101, MetadataUrl: "eigensdk-go", @@ -132,14 +132,12 @@ func TestChainWriter(t *testing.T) { walletModified, err := crypto.HexToECDSA("2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6") assert.NoError(t, err) walletModifiedAddress := crypto.PubkeyToAddress(walletModified.PublicKey) - operator := types.Operator{ - Address: walletModifiedAddress.Hex(), + Address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", DelegationApproverAddress: walletModifiedAddress.Hex(), AllocationDelay: 101, MetadataUrl: "eigensdk-go", } - receipt, err := clients.ElChainWriter.UpdateMetadataURI(context.Background(), operator, "https://0.0.0.0", true) assert.NoError(t, err) assert.True(t, receipt.Status == 1)