Skip to content

Commit

Permalink
fix readconfig and errors not used
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodeymo committed Dec 30, 2024
1 parent e352700 commit ad7042a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (o *Operator) RegisterOperatorWithEigenlayer() error {
}

func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big.Int) error {
_, tokenAddr, err := o.eigenlayerReader.GetStrategyAndUnderlyingToken(&bind.CallOpts{}, strategyAddr)
_, tokenAddr, err := o.eigenlayerReader.GetStrategyAndUnderlyingToken(nil, strategyAddr)
if err != nil {
o.logger.Error("Failed to fetch strategy contract", "err", err)
return err
Expand All @@ -74,6 +74,10 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big.
return err
}
txOpts, err := o.avsWriter.TxMgr.GetNoSendTxOpts()
if err != nil {
o.logger.Errorf("Error in GetNoSendTxOpts")
return err
}
tx, err := contractErc20Mock.Mint(txOpts, o.operatorAddr, amount)
if err != nil {
o.logger.Errorf("Error assembling Mint tx")
Expand Down
11 changes: 7 additions & 4 deletions plugin/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import (
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Layr-Labs/eigensdk-go/signerv2"
sdktypes "github.com/Layr-Labs/eigensdk-go/types"
"github.com/Layr-Labs/eigensdk-go/utils"
commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/chainio"
"github.com/Layr-Labs/incredible-squaring-avs/types"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/urfave/cli"
Expand Down Expand Up @@ -86,7 +85,7 @@ func plugin(ctx *cli.Context) {
configPath := ctx.GlobalString(ConfigFileFlag.Name)

avsConfig := types.NodeConfig{}
err := utils.ReadYamlConfig(configPath, &avsConfig)
err := commonincredible.ReadYamlConfig(configPath, &avsConfig)
if err != nil {
fmt.Println(err)
return
Expand Down Expand Up @@ -134,6 +133,10 @@ func plugin(ctx *cli.Context) {
return
}
clients, err := sdkclients.BuildAll(buildClientConfig, operatorEcdsaPrivateKey, logger)
if err != nil {
fmt.Println(err)
return
}
avsReader, err := chainio.BuildAvsReader(
common.HexToAddress(avsConfig.AVSRegistryCoordinatorAddress),
common.HexToAddress(avsConfig.OperatorStateRetrieverAddress),
Expand Down Expand Up @@ -201,7 +204,7 @@ func plugin(ctx *cli.Context) {
return
}
strategyAddr := common.HexToAddress(ctx.GlobalString(StrategyAddrFlag.Name))
_, tokenAddr, err := clients.ElChainReader.GetStrategyAndUnderlyingToken(&bind.CallOpts{}, strategyAddr)
_, tokenAddr, err := clients.ElChainReader.GetStrategyAndUnderlyingToken(nil, strategyAddr)
if err != nil {
logger.Error("Failed to fetch strategy contract", "err", err)
return
Expand Down

0 comments on commit ad7042a

Please sign in to comment.