Skip to content

Commit

Permalink
fix: add approval
Browse files Browse the repository at this point in the history
  • Loading branch information
stevennevins committed Oct 17, 2024
1 parent dea12a8 commit 7494e85
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,20 @@ func (o *Operator) registerOperatorOnStartup(
} else {
o.logger.Infof("Registered operator with eigenlayer")
}

// TODO(samlaf): shouldn't hardcode number here
amount := big.NewInt(1000)
// Approve tokens
tx, err = contractErc20Mock.Approve(txOpts, strategyAddr, amount)

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: tx

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: contractErc20Mock

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: txOpts

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: strategyAddr

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: tx

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: contractErc20Mock

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: txOpts

Check failure on line 39 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: strategyAddr
if err != nil {
o.logger.Error("Error assembling Approve tx", "err", err)
return err

Check failure on line 42 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

too many return values

Check failure on line 42 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

too many return values
}
_, err = o.avsWriter.TxMgr.Send(context.Background(), tx)

Check failure on line 44 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: tx

Check failure on line 44 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

undefined: tx
if err != nil {
o.logger.Error("Error submitting Approve tx", "err", err)
return err

Check failure on line 47 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Integration Test

too many return values

Check failure on line 47 in operator/registration.go

View workflow job for this annotation

GitHub Actions / Unit Test

too many return values
}

err = o.DepositIntoStrategy(mockTokenStrategyAddr, amount)
if err != nil {
o.logger.Fatal("Error depositing into strategy", "err", err)
Expand Down
2 changes: 1 addition & 1 deletion tests/anvil/avs-and-eigenlayer-deployed-anvil-state.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/anvil/eigenlayer-deployed-anvil-state.json

Large diffs are not rendered by default.

0 comments on commit 7494e85

Please sign in to comment.