Skip to content

Commit

Permalink
test: add token approval
Browse files Browse the repository at this point in the history
  • Loading branch information
stevennevins committed Oct 17, 2024
1 parent 11a08f0 commit dea12a8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big.
return err
}

// Approve tokens
tx, err = contractErc20Mock.Approve(txOpts, strategyAddr, amount)
if err != nil {
o.logger.Error("Error assembling Approve tx", "err", err)
return err
}
_, err = o.avsWriter.TxMgr.Send(context.Background(), tx)
if err != nil {
o.logger.Error("Error submitting Approve tx", "err", err)
return err
}

// Deposit into strategy
_, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount)
if err != nil {
o.logger.Errorf("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.

2 changes: 1 addition & 1 deletion tests/anvil/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
}
},
"number": "7",
"number": "6",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"config": {
Expand Down

0 comments on commit dea12a8

Please sign in to comment.