diff --git a/Makefile b/Makefile index 97bc876e..438a94f0 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,10 @@ help: @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' bindings: ## generates contract bindings - cd contracts && rm -rf bindings/* && ./generate-bindings.sh + cd contracts && rm -rf bindings/* && ./generate-bindings.sh + +eigenpod-bindings: ## generates contract bindings for eigenpod + cd chainio/clients/eigenpod && ./generate.sh mocks: ## generates mocks go install go.uber.org/mock/mockgen@v0.4.0 diff --git a/chainio/clients/avsregistry/bindings.go b/chainio/clients/avsregistry/bindings.go index 98ce0891..776dca36 100644 --- a/chainio/clients/avsregistry/bindings.go +++ b/chainio/clients/avsregistry/bindings.go @@ -41,7 +41,7 @@ type ContractBindings struct { func NewAVSRegistryContractBindings( registryCoordinatorAddr gethcommon.Address, operatorStateRetrieverAddr gethcommon.Address, - ethclient eth.Client, + ethclient eth.HttpBackend, logger logging.Logger, ) (*ContractBindings, error) { contractBlsRegistryCoordinator, err := regcoordinator.NewContractRegistryCoordinator( @@ -124,7 +124,7 @@ func NewAVSRegistryContractBindings( // NewBindingsFromConfig creates a new instance of ContractBindings func NewBindingsFromConfig( cfg Config, - client eth.Client, + client eth.HttpBackend, logger logging.Logger, ) (*ContractBindings, error) { var ( diff --git a/chainio/clients/avsregistry/builder.go b/chainio/clients/avsregistry/builder.go index 81787f1f..c46b96bd 100644 --- a/chainio/clients/avsregistry/builder.go +++ b/chainio/clients/avsregistry/builder.go @@ -9,8 +9,8 @@ import ( func BuildClients( config Config, - client eth.Client, - wsClient eth.Client, + client eth.HttpBackend, + wsClient eth.WsBackend, txMgr txmgr.TxManager, logger logging.Logger, ) (*ChainReader, *ChainSubscriber, *ChainWriter, *ContractBindings, error) { diff --git a/chainio/clients/avsregistry/reader.go b/chainio/clients/avsregistry/reader.go index 64120b40..dac569c7 100644 --- a/chainio/clients/avsregistry/reader.go +++ b/chainio/clients/avsregistry/reader.go @@ -25,69 +25,6 @@ import ( // 10k is an arbitrary choice that should work for most var DefaultQueryBlockRange = big.NewInt(10_000) -type Reader interface { - GetQuorumCount(opts *bind.CallOpts) (uint8, error) - - GetOperatorsStakeInQuorumsAtCurrentBlock( - opts *bind.CallOpts, - quorumNumbers types.QuorumNums, - ) ([][]opstateretriever.OperatorStateRetrieverOperator, error) - - GetOperatorsStakeInQuorumsAtBlock( - opts *bind.CallOpts, - quorumNumbers types.QuorumNums, - blockNumber uint32, - ) ([][]opstateretriever.OperatorStateRetrieverOperator, error) - - GetOperatorAddrsInQuorumsAtCurrentBlock( - opts *bind.CallOpts, - quorumNumbers types.QuorumNums, - ) ([][]common.Address, error) - - GetOperatorsStakeInQuorumsOfOperatorAtBlock( - opts *bind.CallOpts, - operatorId types.OperatorId, - blockNumber uint32, - ) (types.QuorumNums, [][]opstateretriever.OperatorStateRetrieverOperator, error) - - GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock( - opts *bind.CallOpts, - operatorId types.OperatorId, - ) (types.QuorumNums, [][]opstateretriever.OperatorStateRetrieverOperator, error) - - GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock( - opts *bind.CallOpts, - operatorId types.OperatorId, - ) (map[types.QuorumNum]types.StakeAmount, error) - - GetCheckSignaturesIndices( - opts *bind.CallOpts, - referenceBlockNumber uint32, - quorumNumbers types.QuorumNums, - nonSignerOperatorIds []types.OperatorId, - ) (opstateretriever.OperatorStateRetrieverCheckSignaturesIndices, error) - - GetOperatorId(opts *bind.CallOpts, operatorAddress common.Address) ([32]byte, error) - - GetOperatorFromId(opts *bind.CallOpts, operatorId types.OperatorId) (common.Address, error) - - IsOperatorRegistered(opts *bind.CallOpts, operatorAddress common.Address) (bool, error) - - QueryExistingRegisteredOperatorPubKeys( - ctx context.Context, - startBlock *big.Int, - stopBlock *big.Int, - blockRange *big.Int, - ) ([]types.OperatorAddr, []types.OperatorPubkeys, error) - - QueryExistingRegisteredOperatorSockets( - ctx context.Context, - startBlock *big.Int, - stopBlock *big.Int, - blockRange *big.Int, - ) (map[types.OperatorId]types.Socket, error) -} - type Config struct { RegistryCoordinatorAddress common.Address OperatorStateRetrieverAddress common.Address @@ -100,12 +37,9 @@ type ChainReader struct { registryCoordinator *regcoord.ContractRegistryCoordinator operatorStateRetriever *opstateretriever.ContractOperatorStateRetriever stakeRegistry *stakeregistry.ContractStakeRegistry - ethClient eth.Client + ethClient eth.HttpBackend } -// forces AvsReader to implement the clients.ReaderInterface interface -var _ Reader = (*ChainReader)(nil) - func NewChainReader( registryCoordinatorAddr common.Address, blsApkRegistryAddr common.Address, @@ -113,7 +47,7 @@ func NewChainReader( operatorStateRetriever *opstateretriever.ContractOperatorStateRetriever, stakeRegistry *stakeregistry.ContractStakeRegistry, logger logging.Logger, - ethClient eth.Client, + ethClient eth.HttpBackend, ) *ChainReader { logger = logger.With(logging.ComponentKey, "avsregistry/ChainReader") @@ -131,7 +65,7 @@ func NewChainReader( // NewReaderFromConfig creates a new ChainReader func NewReaderFromConfig( cfg Config, - client eth.Client, + client eth.HttpBackend, logger logging.Logger, ) (*ChainReader, error) { bindings, err := NewBindingsFromConfig(cfg, client, logger) @@ -155,7 +89,7 @@ func NewReaderFromConfig( func BuildAvsRegistryChainReader( registryCoordinatorAddr common.Address, operatorStateRetrieverAddr common.Address, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, ) (*ChainReader, error) { contractRegistryCoordinator, err := regcoord.NewContractRegistryCoordinator(registryCoordinatorAddr, ethClient) diff --git a/chainio/clients/avsregistry/subscriber.go b/chainio/clients/avsregistry/subscriber.go index 26f3dde2..70d188b7 100644 --- a/chainio/clients/avsregistry/subscriber.go +++ b/chainio/clients/avsregistry/subscriber.go @@ -12,20 +12,12 @@ import ( "github.com/Layr-Labs/eigensdk-go/utils" ) -type Subscriber interface { - SubscribeToNewPubkeyRegistrations() (chan *blsapkreg.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) - SubscribeToOperatorSocketUpdates() (chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) -} - type ChainSubscriber struct { logger logging.Logger regCoord regcoord.ContractRegistryCoordinatorFilters blsApkRegistry blsapkreg.ContractBLSApkRegistryFilters } -// forces EthSubscriber to implement the chainio.Subscriber interface -var _ Subscriber = (*ChainSubscriber)(nil) - // NewChainSubscriber creates a new instance of ChainSubscriber // The bindings must be created using websocket ETH Client func NewChainSubscriber( @@ -46,7 +38,7 @@ func NewChainSubscriber( // Deprecated: Use NewSubscriberFromConfig instead func BuildAvsRegistryChainSubscriber( regCoordAddr common.Address, - ethWsClient eth.Client, + ethWsClient eth.WsBackend, logger logging.Logger, ) (*ChainSubscriber, error) { regCoord, err := regcoord.NewContractRegistryCoordinator(regCoordAddr, ethWsClient) @@ -68,7 +60,7 @@ func BuildAvsRegistryChainSubscriber( // A websocket ETH Client must be provided func NewSubscriberFromConfig( cfg Config, - wsClient eth.Client, + wsClient eth.WsBackend, logger logging.Logger, ) (*ChainSubscriber, error) { bindings, err := NewBindingsFromConfig(cfg, wsClient, logger) diff --git a/chainio/clients/avsregistry/writer.go b/chainio/clients/avsregistry/writer.go index 1747faf0..9609d4b4 100644 --- a/chainio/clients/avsregistry/writer.go +++ b/chainio/clients/avsregistry/writer.go @@ -27,65 +27,14 @@ import ( "github.com/Layr-Labs/eigensdk-go/utils" ) -type Writer interface { - - // RegisterOperatorInQuorumWithAVSRegistryCoordinator - // TODO(samlaf): an operator that is already registered in a quorum can register with another quorum without passing - // signatures perhaps we should add another sdk function for this purpose, that just takes in a quorumNumber and - // socket? RegisterOperatorInQuorumWithAVSRegistryCoordinator is used to register a single operator with the AVS's - // registry coordinator. - operatorEcdsaPrivateKey is the operator's ecdsa private key (used to sign a message to - // register operator in eigenlayer's delegation manager) - // - operatorToAvsRegistrationSigSalt is a random salt used to prevent replay attacks - // - operatorToAvsRegistrationSigExpiry is the expiry time of the signature - // - // Deprecated: use RegisterOperator instead. - // We will only keep high-level functionality such as RegisterOperator, and low level functionality - // such as this function should eventually all be done with bindings directly instead. - RegisterOperatorInQuorumWithAVSRegistryCoordinator( - ctx context.Context, - operatorEcdsaPrivateKey *ecdsa.PrivateKey, +type eLReader interface { + CalculateOperatorAVSRegistrationDigestHash( + opts *bind.CallOpts, + operatorAddr gethcommon.Address, + serviceManagerAddr gethcommon.Address, operatorToAvsRegistrationSigSalt [32]byte, operatorToAvsRegistrationSigExpiry *big.Int, - blsKeyPair *bls.KeyPair, - quorumNumbers types.QuorumNums, - socket string, - ) (*gethtypes.Receipt, error) - - // RegisterOperator is similar to RegisterOperatorInQuorumWithAVSRegistryCoordinator but - // generates a random salt and expiry for the signature. - RegisterOperator( - ctx context.Context, - operatorEcdsaPrivateKey *ecdsa.PrivateKey, - blsKeyPair *bls.KeyPair, - quorumNumbers types.QuorumNums, - socket string, - ) (*gethtypes.Receipt, error) - - // UpdateStakesOfEntireOperatorSetForQuorums is used by avs teams running https://github.com/Layr-Labs/avs-sync - // to updates the stake of their entire operator set. - // Because of high gas costs of this operation, it typically needs to be called for every quorum, or perhaps for a - // small grouping of quorums - // (highly dependent on number of operators per quorum) - UpdateStakesOfEntireOperatorSetForQuorums( - ctx context.Context, - operatorsPerQuorum [][]gethcommon.Address, - quorumNumbers types.QuorumNums, - ) (*gethtypes.Receipt, error) - - // UpdateStakesOfOperatorSubsetForAllQuorums is meant to be used by single operators (or teams of operators, - // possibly running https://github.com/Layr-Labs/avs-sync) to update the stake of their own operator(s). This might - // be needed in the case that they received a lot of new stake delegations, and want this to be reflected - // in the AVS's registry coordinator. - UpdateStakesOfOperatorSubsetForAllQuorums( - ctx context.Context, - operators []gethcommon.Address, - ) (*gethtypes.Receipt, error) - - DeregisterOperator( - ctx context.Context, - quorumNumbers types.QuorumNums, - pubkey regcoord.BN254G1Point, - ) (*gethtypes.Receipt, error) + ) ([32]byte, error) } type ChainWriter struct { @@ -94,23 +43,21 @@ type ChainWriter struct { operatorStateRetriever *opstateretriever.ContractOperatorStateRetriever stakeRegistry *stakeregistry.ContractStakeRegistry blsApkRegistry *blsapkregistry.ContractBLSApkRegistry - elReader elcontracts.Reader + elReader eLReader logger logging.Logger - ethClient eth.Client + ethClient eth.HttpBackend txMgr txmgr.TxManager } -var _ Writer = (*ChainWriter)(nil) - func NewChainWriter( serviceManagerAddr gethcommon.Address, registryCoordinator *regcoord.ContractRegistryCoordinator, operatorStateRetriever *opstateretriever.ContractOperatorStateRetriever, stakeRegistry *stakeregistry.ContractStakeRegistry, blsApkRegistry *blsapkregistry.ContractBLSApkRegistry, - elReader elcontracts.Reader, + elReader eLReader, logger logging.Logger, - ethClient eth.Client, + ethClient eth.HttpBackend, txMgr txmgr.TxManager, ) *ChainWriter { logger = logger.With(logging.ComponentKey, "avsregistry/ChainWriter") @@ -134,7 +81,7 @@ func BuildAvsRegistryChainWriter( registryCoordinatorAddr gethcommon.Address, operatorStateRetrieverAddr gethcommon.Address, logger logging.Logger, - ethClient eth.Client, + ethClient eth.HttpBackend, txMgr txmgr.TxManager, ) (*ChainWriter, error) { registryCoordinator, err := regcoord.NewContractRegistryCoordinator(registryCoordinatorAddr, ethClient) @@ -200,7 +147,7 @@ func BuildAvsRegistryChainWriter( // NewWriterFromConfig creates a new ChainWriter from the provided config func NewWriterFromConfig( cfg Config, - client eth.Client, + client eth.HttpBackend, txMgr txmgr.TxManager, logger logging.Logger, ) (*ChainWriter, error) { @@ -229,6 +176,18 @@ func NewWriterFromConfig( ), nil } +// RegisterOperatorInQuorumWithAVSRegistryCoordinator +// TODO(samlaf): an operator that is already registered in a quorum can register with another quorum without passing +// signatures perhaps we should add another sdk function for this purpose, that just takes in a quorumNumber and +// socket? RegisterOperatorInQuorumWithAVSRegistryCoordinator is used to register a single operator with the AVS's +// registry coordinator. - operatorEcdsaPrivateKey is the operator's ecdsa private key (used to sign a message to +// register operator in eigenlayer's delegation manager) +// - operatorToAvsRegistrationSigSalt is a random salt used to prevent replay attacks +// - operatorToAvsRegistrationSigExpiry is the expiry time of the signature +// +// Deprecated: use RegisterOperator instead. +// We will only keep high-level functionality such as RegisterOperator, and low level functionality +// such as this function should eventually all be done with bindings directly instead. func (w *ChainWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator( ctx context.Context, // we need to pass the private key explicitly and can't use the signer because registering requires signing a @@ -330,6 +289,8 @@ func (w *ChainWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator( return receipt, nil } +// RegisterOperator is similar to RegisterOperatorInQuorumWithAVSRegistryCoordinator but +// generates a random salt and expiry for the signature. func (w *ChainWriter) RegisterOperator( ctx context.Context, // we need to pass the private key explicitly and can't use the signer because registering requires signing a @@ -447,6 +408,11 @@ func (w *ChainWriter) RegisterOperator( return receipt, nil } +// UpdateStakesOfEntireOperatorSetForQuorums is used by avs teams running https://github.com/Layr-Labs/avs-sync +// to updates the stake of their entire operator set. +// Because of high gas costs of this operation, it typically needs to be called for every quorum, or perhaps for a +// small grouping of quorums +// (highly dependent on number of operators per quorum) func (w *ChainWriter) UpdateStakesOfEntireOperatorSetForQuorums( ctx context.Context, operatorsPerQuorum [][]gethcommon.Address, diff --git a/chainio/clients/builder.go b/chainio/clients/builder.go index c3f4b320..31d9559f 100644 --- a/chainio/clients/builder.go +++ b/chainio/clients/builder.go @@ -5,6 +5,8 @@ import ( "crypto/ecdsa" "time" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" "github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts" "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" @@ -39,8 +41,8 @@ type Clients struct { AvsRegistryChainWriter *avsregistry.ChainWriter ElChainReader *elcontracts.ChainReader ElChainWriter *elcontracts.ChainWriter - EthHttpClient eth.Client - EthWsClient eth.Client + EthHttpClient eth.HttpBackend + EthWsClient eth.WsBackend Wallet wallet.Wallet TxManager txmgr.TxManager AvsRegistryContractBindings *avsregistry.ContractBindings @@ -61,12 +63,12 @@ func BuildAll( eigenMetrics := metrics.NewEigenMetrics(config.AvsName, config.PromMetricsIpPortAddress, promReg, logger) // creating two types of Eth clients: HTTP and WS - ethHttpClient, err := eth.NewClient(config.EthHttpUrl) + ethHttpClient, err := ethclient.Dial(config.EthHttpUrl) if err != nil { return nil, utils.WrapError("Failed to create Eth Http client", err) } - ethWsClient, err := eth.NewClient(config.EthWsUrl) + ethWsClient, err := ethclient.Dial(config.EthWsUrl) if err != nil { return nil, utils.WrapError("Failed to create Eth WS client", err) } diff --git a/chainio/clients/eigenpod/bindings.go b/chainio/clients/eigenpod/bindings.go new file mode 100644 index 00000000..8844f26b --- /dev/null +++ b/chainio/clients/eigenpod/bindings.go @@ -0,0 +1,84 @@ +package eigenpod + +import ( + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eigenpod/bindings" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + + "github.com/ethereum/go-ethereum/common" +) + +type ContractBindings struct { + Address common.Address + *bindings.IEigenPod +} + +type ContractCallerBindings struct { + Address common.Address + *bindings.IEigenPodCaller +} + +type ManagerContractBindings struct { + Address common.Address + *bindings.IEigenPodManager +} + +type ManagerContractCallerBindings struct { + Address common.Address + *bindings.IEigenPodManagerCaller +} + +func NewContractBindings( + address common.Address, + ethClient eth.HttpBackend, +) (*ContractBindings, error) { + pod, err := bindings.NewIEigenPod(address, ethClient) + if err != nil { + return nil, err + } + return &ContractBindings{ + Address: address, + IEigenPod: pod, + }, nil +} + +func NewContractCallerBindings( + address common.Address, + ethClient eth.HttpBackend, +) (*ContractCallerBindings, error) { + pod, err := bindings.NewIEigenPodCaller(address, ethClient) + if err != nil { + return nil, err + } + return &ContractCallerBindings{ + Address: address, + IEigenPodCaller: pod, + }, nil +} + +func NewManagerContractBindings( + address common.Address, + ethClient eth.HttpBackend, +) (*ManagerContractBindings, error) { + manager, err := bindings.NewIEigenPodManager(address, ethClient) + if err != nil { + return nil, err + } + return &ManagerContractBindings{ + Address: address, + IEigenPodManager: manager, + }, nil +} + +func NewManagerContractCallerBindings( + address common.Address, + ethClient eth.HttpBackend, +) (*ManagerContractCallerBindings, error) { + manager, err := bindings.NewIEigenPodManagerCaller(address, ethClient) + if err != nil { + return nil, err + } + return &ManagerContractCallerBindings{ + Address: address, + IEigenPodManagerCaller: manager, + }, nil +} diff --git a/chainio/clients/eigenpod/bindings/IEigenPod.go b/chainio/clients/eigenpod/bindings/IEigenPod.go new file mode 100644 index 00000000..79578804 --- /dev/null +++ b/chainio/clients/eigenpod/bindings/IEigenPod.go @@ -0,0 +1,2268 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// BeaconChainProofsBalanceContainerProof is an auto generated low-level Go binding around an user-defined struct. +type BeaconChainProofsBalanceContainerProof struct { + BalanceContainerRoot [32]byte + Proof []byte +} + +// BeaconChainProofsBalanceProof is an auto generated low-level Go binding around an user-defined struct. +type BeaconChainProofsBalanceProof struct { + PubkeyHash [32]byte + BalanceRoot [32]byte + Proof []byte +} + +// BeaconChainProofsStateRootProof is an auto generated low-level Go binding around an user-defined struct. +type BeaconChainProofsStateRootProof struct { + BeaconStateRoot [32]byte + Proof []byte +} + +// BeaconChainProofsValidatorProof is an auto generated low-level Go binding around an user-defined struct. +type BeaconChainProofsValidatorProof struct { + ValidatorFields [][32]byte + Proof []byte +} + +// IEigenPodCheckpoint is an auto generated low-level Go binding around an user-defined struct. +type IEigenPodCheckpoint struct { + BeaconBlockRoot [32]byte + ProofsRemaining *big.Int + PodBalanceGwei uint64 + BalanceDeltasGwei *big.Int +} + +// IEigenPodValidatorInfo is an auto generated low-level Go binding around an user-defined struct. +type IEigenPodValidatorInfo struct { + ValidatorIndex uint64 + RestakedBalanceGwei uint64 + LastCheckpointedAt uint64 + Status uint8 +} + +// IEigenPodMetaData contains all meta data concerning the IEigenPod contract. +var IEigenPodMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"activeValidatorCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkpointBalanceExitedGwei\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpoint\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.Checkpoint\",\"components\":[{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proofsRemaining\",\"type\":\"uint24\",\"internalType\":\"uint24\"},{\"name\":\"podBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"balanceDeltasGwei\",\"type\":\"int128\",\"internalType\":\"int128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getParentBlockRoot\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"podOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proofSubmitter\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recoverTokens\",\"inputs\":[{\"name\":\"tokenList\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"amountsToWithdraw\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setProofSubmitter\",\"inputs\":[{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"startCheckpoint\",\"inputs\":[{\"name\":\"revertIfNoBalance\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validatorPubkeyHashToInfo\",\"inputs\":[{\"name\":\"validatorPubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorPubkeyToInfo\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyCheckpointProofs\",\"inputs\":[{\"name\":\"balanceContainerProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.BalanceContainerProof\",\"components\":[{\"name\":\"balanceContainerRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proofs\",\"type\":\"tuple[]\",\"internalType\":\"structBeaconChainProofs.BalanceProof[]\",\"components\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"balanceRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyStaleBalance\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.ValidatorProof\",\"components\":[{\"name\":\"validatorFields\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyWithdrawalCredentials\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"validatorIndices\",\"type\":\"uint40[]\",\"internalType\":\"uint40[]\"},{\"name\":\"validatorFieldsProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"validatorFields\",\"type\":\"bytes32[][]\",\"internalType\":\"bytes32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawRestakedBeaconChainETH\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawableRestakedExecutionLayerGwei\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CheckpointCreated\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validatorCount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"CheckpointFinalized\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"totalShareDeltaWei\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EigenPodStaked\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NonBeaconChainETHReceived\",\"inputs\":[{\"name\":\"amountReceived\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ProofSubmitterUpdated\",\"inputs\":[{\"name\":\"prevProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RestakedBeaconChainETHWithdrawn\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorBalanceUpdated\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"},{\"name\":\"balanceTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"newValidatorBalanceGwei\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorCheckpointed\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRestaked\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWithdrawn\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false}]", +} + +// IEigenPodABI is the input ABI used to generate the binding from. +// Deprecated: Use IEigenPodMetaData.ABI instead. +var IEigenPodABI = IEigenPodMetaData.ABI + +// IEigenPod is an auto generated Go binding around an Ethereum contract. +type IEigenPod struct { + IEigenPodCaller // Read-only binding to the contract + IEigenPodTransactor // Write-only binding to the contract + IEigenPodFilterer // Log filterer for contract events +} + +// IEigenPodCaller is an auto generated read-only Go binding around an Ethereum contract. +type IEigenPodCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IEigenPodTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IEigenPodFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IEigenPodSession struct { + Contract *IEigenPod // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IEigenPodCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IEigenPodCallerSession struct { + Contract *IEigenPodCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IEigenPodTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IEigenPodTransactorSession struct { + Contract *IEigenPodTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IEigenPodRaw is an auto generated low-level Go binding around an Ethereum contract. +type IEigenPodRaw struct { + Contract *IEigenPod // Generic contract binding to access the raw methods on +} + +// IEigenPodCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IEigenPodCallerRaw struct { + Contract *IEigenPodCaller // Generic read-only contract binding to access the raw methods on +} + +// IEigenPodTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IEigenPodTransactorRaw struct { + Contract *IEigenPodTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIEigenPod creates a new instance of IEigenPod, bound to a specific deployed contract. +func NewIEigenPod(address common.Address, backend bind.ContractBackend) (*IEigenPod, error) { + contract, err := bindIEigenPod(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IEigenPod{IEigenPodCaller: IEigenPodCaller{contract: contract}, IEigenPodTransactor: IEigenPodTransactor{contract: contract}, IEigenPodFilterer: IEigenPodFilterer{contract: contract}}, nil +} + +// NewIEigenPodCaller creates a new read-only instance of IEigenPod, bound to a specific deployed contract. +func NewIEigenPodCaller(address common.Address, caller bind.ContractCaller) (*IEigenPodCaller, error) { + contract, err := bindIEigenPod(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IEigenPodCaller{contract: contract}, nil +} + +// NewIEigenPodTransactor creates a new write-only instance of IEigenPod, bound to a specific deployed contract. +func NewIEigenPodTransactor(address common.Address, transactor bind.ContractTransactor) (*IEigenPodTransactor, error) { + contract, err := bindIEigenPod(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IEigenPodTransactor{contract: contract}, nil +} + +// NewIEigenPodFilterer creates a new log filterer instance of IEigenPod, bound to a specific deployed contract. +func NewIEigenPodFilterer(address common.Address, filterer bind.ContractFilterer) (*IEigenPodFilterer, error) { + contract, err := bindIEigenPod(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IEigenPodFilterer{contract: contract}, nil +} + +// bindIEigenPod binds a generic wrapper to an already deployed contract. +func bindIEigenPod(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IEigenPodMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IEigenPod *IEigenPodRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IEigenPod.Contract.IEigenPodCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IEigenPod *IEigenPodRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPod.Contract.IEigenPodTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IEigenPod *IEigenPodRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IEigenPod.Contract.IEigenPodTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IEigenPod *IEigenPodCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IEigenPod.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IEigenPod *IEigenPodTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPod.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IEigenPod *IEigenPodTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IEigenPod.Contract.contract.Transact(opts, method, params...) +} + +// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. +// +// Solidity: function activeValidatorCount() view returns(uint256) +func (_IEigenPod *IEigenPodCaller) ActiveValidatorCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "activeValidatorCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. +// +// Solidity: function activeValidatorCount() view returns(uint256) +func (_IEigenPod *IEigenPodSession) ActiveValidatorCount() (*big.Int, error) { + return _IEigenPod.Contract.ActiveValidatorCount(&_IEigenPod.CallOpts) +} + +// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. +// +// Solidity: function activeValidatorCount() view returns(uint256) +func (_IEigenPod *IEigenPodCallerSession) ActiveValidatorCount() (*big.Int, error) { + return _IEigenPod.Contract.ActiveValidatorCount(&_IEigenPod.CallOpts) +} + +// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. +// +// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) +func (_IEigenPod *IEigenPodCaller) CheckpointBalanceExitedGwei(opts *bind.CallOpts, arg0 uint64) (uint64, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "checkpointBalanceExitedGwei", arg0) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. +// +// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) +func (_IEigenPod *IEigenPodSession) CheckpointBalanceExitedGwei(arg0 uint64) (uint64, error) { + return _IEigenPod.Contract.CheckpointBalanceExitedGwei(&_IEigenPod.CallOpts, arg0) +} + +// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. +// +// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) +func (_IEigenPod *IEigenPodCallerSession) CheckpointBalanceExitedGwei(arg0 uint64) (uint64, error) { + return _IEigenPod.Contract.CheckpointBalanceExitedGwei(&_IEigenPod.CallOpts, arg0) +} + +// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. +// +// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) +func (_IEigenPod *IEigenPodCaller) CurrentCheckpoint(opts *bind.CallOpts) (IEigenPodCheckpoint, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "currentCheckpoint") + + if err != nil { + return *new(IEigenPodCheckpoint), err + } + + out0 := *abi.ConvertType(out[0], new(IEigenPodCheckpoint)).(*IEigenPodCheckpoint) + + return out0, err + +} + +// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. +// +// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) +func (_IEigenPod *IEigenPodSession) CurrentCheckpoint() (IEigenPodCheckpoint, error) { + return _IEigenPod.Contract.CurrentCheckpoint(&_IEigenPod.CallOpts) +} + +// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. +// +// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) +func (_IEigenPod *IEigenPodCallerSession) CurrentCheckpoint() (IEigenPodCheckpoint, error) { + return _IEigenPod.Contract.CurrentCheckpoint(&_IEigenPod.CallOpts) +} + +// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. +// +// Solidity: function currentCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodCaller) CurrentCheckpointTimestamp(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "currentCheckpointTimestamp") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. +// +// Solidity: function currentCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodSession) CurrentCheckpointTimestamp() (uint64, error) { + return _IEigenPod.Contract.CurrentCheckpointTimestamp(&_IEigenPod.CallOpts) +} + +// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. +// +// Solidity: function currentCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodCallerSession) CurrentCheckpointTimestamp() (uint64, error) { + return _IEigenPod.Contract.CurrentCheckpointTimestamp(&_IEigenPod.CallOpts) +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_IEigenPod *IEigenPodCaller) EigenPodManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "eigenPodManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_IEigenPod *IEigenPodSession) EigenPodManager() (common.Address, error) { + return _IEigenPod.Contract.EigenPodManager(&_IEigenPod.CallOpts) +} + +// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. +// +// Solidity: function eigenPodManager() view returns(address) +func (_IEigenPod *IEigenPodCallerSession) EigenPodManager() (common.Address, error) { + return _IEigenPod.Contract.EigenPodManager(&_IEigenPod.CallOpts) +} + +// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. +// +// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) +func (_IEigenPod *IEigenPodCaller) GetParentBlockRoot(opts *bind.CallOpts, timestamp uint64) ([32]byte, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "getParentBlockRoot", timestamp) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. +// +// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) +func (_IEigenPod *IEigenPodSession) GetParentBlockRoot(timestamp uint64) ([32]byte, error) { + return _IEigenPod.Contract.GetParentBlockRoot(&_IEigenPod.CallOpts, timestamp) +} + +// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. +// +// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) +func (_IEigenPod *IEigenPodCallerSession) GetParentBlockRoot(timestamp uint64) ([32]byte, error) { + return _IEigenPod.Contract.GetParentBlockRoot(&_IEigenPod.CallOpts, timestamp) +} + +// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. +// +// Solidity: function lastCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodCaller) LastCheckpointTimestamp(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "lastCheckpointTimestamp") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. +// +// Solidity: function lastCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodSession) LastCheckpointTimestamp() (uint64, error) { + return _IEigenPod.Contract.LastCheckpointTimestamp(&_IEigenPod.CallOpts) +} + +// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. +// +// Solidity: function lastCheckpointTimestamp() view returns(uint64) +func (_IEigenPod *IEigenPodCallerSession) LastCheckpointTimestamp() (uint64, error) { + return _IEigenPod.Contract.LastCheckpointTimestamp(&_IEigenPod.CallOpts) +} + +// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. +// +// Solidity: function podOwner() view returns(address) +func (_IEigenPod *IEigenPodCaller) PodOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "podOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. +// +// Solidity: function podOwner() view returns(address) +func (_IEigenPod *IEigenPodSession) PodOwner() (common.Address, error) { + return _IEigenPod.Contract.PodOwner(&_IEigenPod.CallOpts) +} + +// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. +// +// Solidity: function podOwner() view returns(address) +func (_IEigenPod *IEigenPodCallerSession) PodOwner() (common.Address, error) { + return _IEigenPod.Contract.PodOwner(&_IEigenPod.CallOpts) +} + +// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. +// +// Solidity: function proofSubmitter() view returns(address) +func (_IEigenPod *IEigenPodCaller) ProofSubmitter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "proofSubmitter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. +// +// Solidity: function proofSubmitter() view returns(address) +func (_IEigenPod *IEigenPodSession) ProofSubmitter() (common.Address, error) { + return _IEigenPod.Contract.ProofSubmitter(&_IEigenPod.CallOpts) +} + +// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. +// +// Solidity: function proofSubmitter() view returns(address) +func (_IEigenPod *IEigenPodCallerSession) ProofSubmitter() (common.Address, error) { + return _IEigenPod.Contract.ProofSubmitter(&_IEigenPod.CallOpts) +} + +// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. +// +// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodCaller) ValidatorPubkeyHashToInfo(opts *bind.CallOpts, validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "validatorPubkeyHashToInfo", validatorPubkeyHash) + + if err != nil { + return *new(IEigenPodValidatorInfo), err + } + + out0 := *abi.ConvertType(out[0], new(IEigenPodValidatorInfo)).(*IEigenPodValidatorInfo) + + return out0, err + +} + +// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. +// +// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodSession) ValidatorPubkeyHashToInfo(validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { + return _IEigenPod.Contract.ValidatorPubkeyHashToInfo(&_IEigenPod.CallOpts, validatorPubkeyHash) +} + +// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. +// +// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodCallerSession) ValidatorPubkeyHashToInfo(validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { + return _IEigenPod.Contract.ValidatorPubkeyHashToInfo(&_IEigenPod.CallOpts, validatorPubkeyHash) +} + +// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. +// +// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodCaller) ValidatorPubkeyToInfo(opts *bind.CallOpts, validatorPubkey []byte) (IEigenPodValidatorInfo, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "validatorPubkeyToInfo", validatorPubkey) + + if err != nil { + return *new(IEigenPodValidatorInfo), err + } + + out0 := *abi.ConvertType(out[0], new(IEigenPodValidatorInfo)).(*IEigenPodValidatorInfo) + + return out0, err + +} + +// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. +// +// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodSession) ValidatorPubkeyToInfo(validatorPubkey []byte) (IEigenPodValidatorInfo, error) { + return _IEigenPod.Contract.ValidatorPubkeyToInfo(&_IEigenPod.CallOpts, validatorPubkey) +} + +// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. +// +// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) +func (_IEigenPod *IEigenPodCallerSession) ValidatorPubkeyToInfo(validatorPubkey []byte) (IEigenPodValidatorInfo, error) { + return _IEigenPod.Contract.ValidatorPubkeyToInfo(&_IEigenPod.CallOpts, validatorPubkey) +} + +// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. +// +// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) +func (_IEigenPod *IEigenPodCaller) ValidatorStatus(opts *bind.CallOpts, validatorPubkey []byte) (uint8, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "validatorStatus", validatorPubkey) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. +// +// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) +func (_IEigenPod *IEigenPodSession) ValidatorStatus(validatorPubkey []byte) (uint8, error) { + return _IEigenPod.Contract.ValidatorStatus(&_IEigenPod.CallOpts, validatorPubkey) +} + +// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. +// +// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) +func (_IEigenPod *IEigenPodCallerSession) ValidatorStatus(validatorPubkey []byte) (uint8, error) { + return _IEigenPod.Contract.ValidatorStatus(&_IEigenPod.CallOpts, validatorPubkey) +} + +// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. +// +// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) +func (_IEigenPod *IEigenPodCaller) ValidatorStatus0(opts *bind.CallOpts, pubkeyHash [32]byte) (uint8, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "validatorStatus0", pubkeyHash) + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. +// +// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) +func (_IEigenPod *IEigenPodSession) ValidatorStatus0(pubkeyHash [32]byte) (uint8, error) { + return _IEigenPod.Contract.ValidatorStatus0(&_IEigenPod.CallOpts, pubkeyHash) +} + +// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. +// +// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) +func (_IEigenPod *IEigenPodCallerSession) ValidatorStatus0(pubkeyHash [32]byte) (uint8, error) { + return _IEigenPod.Contract.ValidatorStatus0(&_IEigenPod.CallOpts, pubkeyHash) +} + +// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. +// +// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) +func (_IEigenPod *IEigenPodCaller) WithdrawableRestakedExecutionLayerGwei(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _IEigenPod.contract.Call(opts, &out, "withdrawableRestakedExecutionLayerGwei") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. +// +// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) +func (_IEigenPod *IEigenPodSession) WithdrawableRestakedExecutionLayerGwei() (uint64, error) { + return _IEigenPod.Contract.WithdrawableRestakedExecutionLayerGwei(&_IEigenPod.CallOpts) +} + +// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. +// +// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) +func (_IEigenPod *IEigenPodCallerSession) WithdrawableRestakedExecutionLayerGwei() (uint64, error) { + return _IEigenPod.Contract.WithdrawableRestakedExecutionLayerGwei(&_IEigenPod.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address owner) returns() +func (_IEigenPod *IEigenPodTransactor) Initialize(opts *bind.TransactOpts, owner common.Address) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "initialize", owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address owner) returns() +func (_IEigenPod *IEigenPodSession) Initialize(owner common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.Initialize(&_IEigenPod.TransactOpts, owner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address owner) returns() +func (_IEigenPod *IEigenPodTransactorSession) Initialize(owner common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.Initialize(&_IEigenPod.TransactOpts, owner) +} + +// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. +// +// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() +func (_IEigenPod *IEigenPodTransactor) RecoverTokens(opts *bind.TransactOpts, tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "recoverTokens", tokenList, amountsToWithdraw, recipient) +} + +// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. +// +// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() +func (_IEigenPod *IEigenPodSession) RecoverTokens(tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.RecoverTokens(&_IEigenPod.TransactOpts, tokenList, amountsToWithdraw, recipient) +} + +// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. +// +// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() +func (_IEigenPod *IEigenPodTransactorSession) RecoverTokens(tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.RecoverTokens(&_IEigenPod.TransactOpts, tokenList, amountsToWithdraw, recipient) +} + +// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. +// +// Solidity: function setProofSubmitter(address newProofSubmitter) returns() +func (_IEigenPod *IEigenPodTransactor) SetProofSubmitter(opts *bind.TransactOpts, newProofSubmitter common.Address) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "setProofSubmitter", newProofSubmitter) +} + +// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. +// +// Solidity: function setProofSubmitter(address newProofSubmitter) returns() +func (_IEigenPod *IEigenPodSession) SetProofSubmitter(newProofSubmitter common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.SetProofSubmitter(&_IEigenPod.TransactOpts, newProofSubmitter) +} + +// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. +// +// Solidity: function setProofSubmitter(address newProofSubmitter) returns() +func (_IEigenPod *IEigenPodTransactorSession) SetProofSubmitter(newProofSubmitter common.Address) (*types.Transaction, error) { + return _IEigenPod.Contract.SetProofSubmitter(&_IEigenPod.TransactOpts, newProofSubmitter) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPod *IEigenPodTransactor) Stake(opts *bind.TransactOpts, pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "stake", pubkey, signature, depositDataRoot) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPod *IEigenPodSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPod.Contract.Stake(&_IEigenPod.TransactOpts, pubkey, signature, depositDataRoot) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPod *IEigenPodTransactorSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPod.Contract.Stake(&_IEigenPod.TransactOpts, pubkey, signature, depositDataRoot) +} + +// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. +// +// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() +func (_IEigenPod *IEigenPodTransactor) StartCheckpoint(opts *bind.TransactOpts, revertIfNoBalance bool) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "startCheckpoint", revertIfNoBalance) +} + +// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. +// +// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() +func (_IEigenPod *IEigenPodSession) StartCheckpoint(revertIfNoBalance bool) (*types.Transaction, error) { + return _IEigenPod.Contract.StartCheckpoint(&_IEigenPod.TransactOpts, revertIfNoBalance) +} + +// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. +// +// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() +func (_IEigenPod *IEigenPodTransactorSession) StartCheckpoint(revertIfNoBalance bool) (*types.Transaction, error) { + return _IEigenPod.Contract.StartCheckpoint(&_IEigenPod.TransactOpts, revertIfNoBalance) +} + +// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. +// +// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() +func (_IEigenPod *IEigenPodTransactor) VerifyCheckpointProofs(opts *bind.TransactOpts, balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "verifyCheckpointProofs", balanceContainerProof, proofs) +} + +// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. +// +// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() +func (_IEigenPod *IEigenPodSession) VerifyCheckpointProofs(balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyCheckpointProofs(&_IEigenPod.TransactOpts, balanceContainerProof, proofs) +} + +// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. +// +// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() +func (_IEigenPod *IEigenPodTransactorSession) VerifyCheckpointProofs(balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyCheckpointProofs(&_IEigenPod.TransactOpts, balanceContainerProof, proofs) +} + +// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. +// +// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() +func (_IEigenPod *IEigenPodTransactor) VerifyStaleBalance(opts *bind.TransactOpts, beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "verifyStaleBalance", beaconTimestamp, stateRootProof, proof) +} + +// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. +// +// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() +func (_IEigenPod *IEigenPodSession) VerifyStaleBalance(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyStaleBalance(&_IEigenPod.TransactOpts, beaconTimestamp, stateRootProof, proof) +} + +// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. +// +// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() +func (_IEigenPod *IEigenPodTransactorSession) VerifyStaleBalance(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyStaleBalance(&_IEigenPod.TransactOpts, beaconTimestamp, stateRootProof, proof) +} + +// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. +// +// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() +func (_IEigenPod *IEigenPodTransactor) VerifyWithdrawalCredentials(opts *bind.TransactOpts, beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "verifyWithdrawalCredentials", beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) +} + +// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. +// +// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() +func (_IEigenPod *IEigenPodSession) VerifyWithdrawalCredentials(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyWithdrawalCredentials(&_IEigenPod.TransactOpts, beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) +} + +// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. +// +// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() +func (_IEigenPod *IEigenPodTransactorSession) VerifyWithdrawalCredentials(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { + return _IEigenPod.Contract.VerifyWithdrawalCredentials(&_IEigenPod.TransactOpts, beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) +} + +// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. +// +// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) returns() +func (_IEigenPod *IEigenPodTransactor) WithdrawRestakedBeaconChainETH(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IEigenPod.contract.Transact(opts, "withdrawRestakedBeaconChainETH", recipient, amount) +} + +// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. +// +// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) returns() +func (_IEigenPod *IEigenPodSession) WithdrawRestakedBeaconChainETH(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IEigenPod.Contract.WithdrawRestakedBeaconChainETH(&_IEigenPod.TransactOpts, recipient, amount) +} + +// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. +// +// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amount) returns() +func (_IEigenPod *IEigenPodTransactorSession) WithdrawRestakedBeaconChainETH(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _IEigenPod.Contract.WithdrawRestakedBeaconChainETH(&_IEigenPod.TransactOpts, recipient, amount) +} + +// IEigenPodCheckpointCreatedIterator is returned from FilterCheckpointCreated and is used to iterate over the raw logs and unpacked data for CheckpointCreated events raised by the IEigenPod contract. +type IEigenPodCheckpointCreatedIterator struct { + Event *IEigenPodCheckpointCreated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodCheckpointCreatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodCheckpointCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodCheckpointCreated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodCheckpointCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodCheckpointCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodCheckpointCreated represents a CheckpointCreated event raised by the IEigenPod contract. +type IEigenPodCheckpointCreated struct { + CheckpointTimestamp uint64 + BeaconBlockRoot [32]byte + ValidatorCount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCheckpointCreated is a free log retrieval operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. +// +// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) +func (_IEigenPod *IEigenPodFilterer) FilterCheckpointCreated(opts *bind.FilterOpts, checkpointTimestamp []uint64, beaconBlockRoot [][32]byte) (*IEigenPodCheckpointCreatedIterator, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var beaconBlockRootRule []interface{} + for _, beaconBlockRootItem := range beaconBlockRoot { + beaconBlockRootRule = append(beaconBlockRootRule, beaconBlockRootItem) + } + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "CheckpointCreated", checkpointTimestampRule, beaconBlockRootRule) + if err != nil { + return nil, err + } + return &IEigenPodCheckpointCreatedIterator{contract: _IEigenPod.contract, event: "CheckpointCreated", logs: logs, sub: sub}, nil +} + +// WatchCheckpointCreated is a free log subscription operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. +// +// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) +func (_IEigenPod *IEigenPodFilterer) WatchCheckpointCreated(opts *bind.WatchOpts, sink chan<- *IEigenPodCheckpointCreated, checkpointTimestamp []uint64, beaconBlockRoot [][32]byte) (event.Subscription, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var beaconBlockRootRule []interface{} + for _, beaconBlockRootItem := range beaconBlockRoot { + beaconBlockRootRule = append(beaconBlockRootRule, beaconBlockRootItem) + } + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "CheckpointCreated", checkpointTimestampRule, beaconBlockRootRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodCheckpointCreated) + if err := _IEigenPod.contract.UnpackLog(event, "CheckpointCreated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCheckpointCreated is a log parse operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. +// +// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) +func (_IEigenPod *IEigenPodFilterer) ParseCheckpointCreated(log types.Log) (*IEigenPodCheckpointCreated, error) { + event := new(IEigenPodCheckpointCreated) + if err := _IEigenPod.contract.UnpackLog(event, "CheckpointCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodCheckpointFinalizedIterator is returned from FilterCheckpointFinalized and is used to iterate over the raw logs and unpacked data for CheckpointFinalized events raised by the IEigenPod contract. +type IEigenPodCheckpointFinalizedIterator struct { + Event *IEigenPodCheckpointFinalized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodCheckpointFinalizedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodCheckpointFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodCheckpointFinalized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodCheckpointFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodCheckpointFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodCheckpointFinalized represents a CheckpointFinalized event raised by the IEigenPod contract. +type IEigenPodCheckpointFinalized struct { + CheckpointTimestamp uint64 + TotalShareDeltaWei *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCheckpointFinalized is a free log retrieval operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. +// +// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) +func (_IEigenPod *IEigenPodFilterer) FilterCheckpointFinalized(opts *bind.FilterOpts, checkpointTimestamp []uint64) (*IEigenPodCheckpointFinalizedIterator, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "CheckpointFinalized", checkpointTimestampRule) + if err != nil { + return nil, err + } + return &IEigenPodCheckpointFinalizedIterator{contract: _IEigenPod.contract, event: "CheckpointFinalized", logs: logs, sub: sub}, nil +} + +// WatchCheckpointFinalized is a free log subscription operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. +// +// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) +func (_IEigenPod *IEigenPodFilterer) WatchCheckpointFinalized(opts *bind.WatchOpts, sink chan<- *IEigenPodCheckpointFinalized, checkpointTimestamp []uint64) (event.Subscription, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "CheckpointFinalized", checkpointTimestampRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodCheckpointFinalized) + if err := _IEigenPod.contract.UnpackLog(event, "CheckpointFinalized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCheckpointFinalized is a log parse operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. +// +// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) +func (_IEigenPod *IEigenPodFilterer) ParseCheckpointFinalized(log types.Log) (*IEigenPodCheckpointFinalized, error) { + event := new(IEigenPodCheckpointFinalized) + if err := _IEigenPod.contract.UnpackLog(event, "CheckpointFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodEigenPodStakedIterator is returned from FilterEigenPodStaked and is used to iterate over the raw logs and unpacked data for EigenPodStaked events raised by the IEigenPod contract. +type IEigenPodEigenPodStakedIterator struct { + Event *IEigenPodEigenPodStaked // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodEigenPodStakedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodEigenPodStaked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodEigenPodStaked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodEigenPodStakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodEigenPodStakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodEigenPodStaked represents a EigenPodStaked event raised by the IEigenPod contract. +type IEigenPodEigenPodStaked struct { + Pubkey []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEigenPodStaked is a free log retrieval operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. +// +// Solidity: event EigenPodStaked(bytes pubkey) +func (_IEigenPod *IEigenPodFilterer) FilterEigenPodStaked(opts *bind.FilterOpts) (*IEigenPodEigenPodStakedIterator, error) { + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "EigenPodStaked") + if err != nil { + return nil, err + } + return &IEigenPodEigenPodStakedIterator{contract: _IEigenPod.contract, event: "EigenPodStaked", logs: logs, sub: sub}, nil +} + +// WatchEigenPodStaked is a free log subscription operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. +// +// Solidity: event EigenPodStaked(bytes pubkey) +func (_IEigenPod *IEigenPodFilterer) WatchEigenPodStaked(opts *bind.WatchOpts, sink chan<- *IEigenPodEigenPodStaked) (event.Subscription, error) { + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "EigenPodStaked") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodEigenPodStaked) + if err := _IEigenPod.contract.UnpackLog(event, "EigenPodStaked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEigenPodStaked is a log parse operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. +// +// Solidity: event EigenPodStaked(bytes pubkey) +func (_IEigenPod *IEigenPodFilterer) ParseEigenPodStaked(log types.Log) (*IEigenPodEigenPodStaked, error) { + event := new(IEigenPodEigenPodStaked) + if err := _IEigenPod.contract.UnpackLog(event, "EigenPodStaked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodNonBeaconChainETHReceivedIterator is returned from FilterNonBeaconChainETHReceived and is used to iterate over the raw logs and unpacked data for NonBeaconChainETHReceived events raised by the IEigenPod contract. +type IEigenPodNonBeaconChainETHReceivedIterator struct { + Event *IEigenPodNonBeaconChainETHReceived // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodNonBeaconChainETHReceivedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodNonBeaconChainETHReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodNonBeaconChainETHReceived) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodNonBeaconChainETHReceivedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodNonBeaconChainETHReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodNonBeaconChainETHReceived represents a NonBeaconChainETHReceived event raised by the IEigenPod contract. +type IEigenPodNonBeaconChainETHReceived struct { + AmountReceived *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNonBeaconChainETHReceived is a free log retrieval operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. +// +// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) +func (_IEigenPod *IEigenPodFilterer) FilterNonBeaconChainETHReceived(opts *bind.FilterOpts) (*IEigenPodNonBeaconChainETHReceivedIterator, error) { + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "NonBeaconChainETHReceived") + if err != nil { + return nil, err + } + return &IEigenPodNonBeaconChainETHReceivedIterator{contract: _IEigenPod.contract, event: "NonBeaconChainETHReceived", logs: logs, sub: sub}, nil +} + +// WatchNonBeaconChainETHReceived is a free log subscription operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. +// +// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) +func (_IEigenPod *IEigenPodFilterer) WatchNonBeaconChainETHReceived(opts *bind.WatchOpts, sink chan<- *IEigenPodNonBeaconChainETHReceived) (event.Subscription, error) { + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "NonBeaconChainETHReceived") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodNonBeaconChainETHReceived) + if err := _IEigenPod.contract.UnpackLog(event, "NonBeaconChainETHReceived", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNonBeaconChainETHReceived is a log parse operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. +// +// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) +func (_IEigenPod *IEigenPodFilterer) ParseNonBeaconChainETHReceived(log types.Log) (*IEigenPodNonBeaconChainETHReceived, error) { + event := new(IEigenPodNonBeaconChainETHReceived) + if err := _IEigenPod.contract.UnpackLog(event, "NonBeaconChainETHReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodProofSubmitterUpdatedIterator is returned from FilterProofSubmitterUpdated and is used to iterate over the raw logs and unpacked data for ProofSubmitterUpdated events raised by the IEigenPod contract. +type IEigenPodProofSubmitterUpdatedIterator struct { + Event *IEigenPodProofSubmitterUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodProofSubmitterUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodProofSubmitterUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodProofSubmitterUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodProofSubmitterUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodProofSubmitterUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodProofSubmitterUpdated represents a ProofSubmitterUpdated event raised by the IEigenPod contract. +type IEigenPodProofSubmitterUpdated struct { + PrevProofSubmitter common.Address + NewProofSubmitter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterProofSubmitterUpdated is a free log retrieval operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. +// +// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) +func (_IEigenPod *IEigenPodFilterer) FilterProofSubmitterUpdated(opts *bind.FilterOpts) (*IEigenPodProofSubmitterUpdatedIterator, error) { + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "ProofSubmitterUpdated") + if err != nil { + return nil, err + } + return &IEigenPodProofSubmitterUpdatedIterator{contract: _IEigenPod.contract, event: "ProofSubmitterUpdated", logs: logs, sub: sub}, nil +} + +// WatchProofSubmitterUpdated is a free log subscription operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. +// +// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) +func (_IEigenPod *IEigenPodFilterer) WatchProofSubmitterUpdated(opts *bind.WatchOpts, sink chan<- *IEigenPodProofSubmitterUpdated) (event.Subscription, error) { + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "ProofSubmitterUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodProofSubmitterUpdated) + if err := _IEigenPod.contract.UnpackLog(event, "ProofSubmitterUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseProofSubmitterUpdated is a log parse operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. +// +// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) +func (_IEigenPod *IEigenPodFilterer) ParseProofSubmitterUpdated(log types.Log) (*IEigenPodProofSubmitterUpdated, error) { + event := new(IEigenPodProofSubmitterUpdated) + if err := _IEigenPod.contract.UnpackLog(event, "ProofSubmitterUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodRestakedBeaconChainETHWithdrawnIterator is returned from FilterRestakedBeaconChainETHWithdrawn and is used to iterate over the raw logs and unpacked data for RestakedBeaconChainETHWithdrawn events raised by the IEigenPod contract. +type IEigenPodRestakedBeaconChainETHWithdrawnIterator struct { + Event *IEigenPodRestakedBeaconChainETHWithdrawn // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodRestakedBeaconChainETHWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodRestakedBeaconChainETHWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodRestakedBeaconChainETHWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodRestakedBeaconChainETHWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodRestakedBeaconChainETHWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodRestakedBeaconChainETHWithdrawn represents a RestakedBeaconChainETHWithdrawn event raised by the IEigenPod contract. +type IEigenPodRestakedBeaconChainETHWithdrawn struct { + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRestakedBeaconChainETHWithdrawn is a free log retrieval operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. +// +// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) +func (_IEigenPod *IEigenPodFilterer) FilterRestakedBeaconChainETHWithdrawn(opts *bind.FilterOpts, recipient []common.Address) (*IEigenPodRestakedBeaconChainETHWithdrawnIterator, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "RestakedBeaconChainETHWithdrawn", recipientRule) + if err != nil { + return nil, err + } + return &IEigenPodRestakedBeaconChainETHWithdrawnIterator{contract: _IEigenPod.contract, event: "RestakedBeaconChainETHWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchRestakedBeaconChainETHWithdrawn is a free log subscription operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. +// +// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) +func (_IEigenPod *IEigenPodFilterer) WatchRestakedBeaconChainETHWithdrawn(opts *bind.WatchOpts, sink chan<- *IEigenPodRestakedBeaconChainETHWithdrawn, recipient []common.Address) (event.Subscription, error) { + + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "RestakedBeaconChainETHWithdrawn", recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodRestakedBeaconChainETHWithdrawn) + if err := _IEigenPod.contract.UnpackLog(event, "RestakedBeaconChainETHWithdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRestakedBeaconChainETHWithdrawn is a log parse operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. +// +// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) +func (_IEigenPod *IEigenPodFilterer) ParseRestakedBeaconChainETHWithdrawn(log types.Log) (*IEigenPodRestakedBeaconChainETHWithdrawn, error) { + event := new(IEigenPodRestakedBeaconChainETHWithdrawn) + if err := _IEigenPod.contract.UnpackLog(event, "RestakedBeaconChainETHWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodValidatorBalanceUpdatedIterator is returned from FilterValidatorBalanceUpdated and is used to iterate over the raw logs and unpacked data for ValidatorBalanceUpdated events raised by the IEigenPod contract. +type IEigenPodValidatorBalanceUpdatedIterator struct { + Event *IEigenPodValidatorBalanceUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodValidatorBalanceUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorBalanceUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorBalanceUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodValidatorBalanceUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodValidatorBalanceUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodValidatorBalanceUpdated represents a ValidatorBalanceUpdated event raised by the IEigenPod contract. +type IEigenPodValidatorBalanceUpdated struct { + ValidatorIndex *big.Int + BalanceTimestamp uint64 + NewValidatorBalanceGwei uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorBalanceUpdated is a free log retrieval operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. +// +// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) +func (_IEigenPod *IEigenPodFilterer) FilterValidatorBalanceUpdated(opts *bind.FilterOpts) (*IEigenPodValidatorBalanceUpdatedIterator, error) { + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "ValidatorBalanceUpdated") + if err != nil { + return nil, err + } + return &IEigenPodValidatorBalanceUpdatedIterator{contract: _IEigenPod.contract, event: "ValidatorBalanceUpdated", logs: logs, sub: sub}, nil +} + +// WatchValidatorBalanceUpdated is a free log subscription operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. +// +// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) +func (_IEigenPod *IEigenPodFilterer) WatchValidatorBalanceUpdated(opts *bind.WatchOpts, sink chan<- *IEigenPodValidatorBalanceUpdated) (event.Subscription, error) { + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "ValidatorBalanceUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodValidatorBalanceUpdated) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorBalanceUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseValidatorBalanceUpdated is a log parse operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. +// +// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) +func (_IEigenPod *IEigenPodFilterer) ParseValidatorBalanceUpdated(log types.Log) (*IEigenPodValidatorBalanceUpdated, error) { + event := new(IEigenPodValidatorBalanceUpdated) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorBalanceUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodValidatorCheckpointedIterator is returned from FilterValidatorCheckpointed and is used to iterate over the raw logs and unpacked data for ValidatorCheckpointed events raised by the IEigenPod contract. +type IEigenPodValidatorCheckpointedIterator struct { + Event *IEigenPodValidatorCheckpointed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodValidatorCheckpointedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorCheckpointed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorCheckpointed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodValidatorCheckpointedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodValidatorCheckpointedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodValidatorCheckpointed represents a ValidatorCheckpointed event raised by the IEigenPod contract. +type IEigenPodValidatorCheckpointed struct { + CheckpointTimestamp uint64 + ValidatorIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorCheckpointed is a free log retrieval operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. +// +// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) FilterValidatorCheckpointed(opts *bind.FilterOpts, checkpointTimestamp []uint64, validatorIndex []*big.Int) (*IEigenPodValidatorCheckpointedIterator, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var validatorIndexRule []interface{} + for _, validatorIndexItem := range validatorIndex { + validatorIndexRule = append(validatorIndexRule, validatorIndexItem) + } + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "ValidatorCheckpointed", checkpointTimestampRule, validatorIndexRule) + if err != nil { + return nil, err + } + return &IEigenPodValidatorCheckpointedIterator{contract: _IEigenPod.contract, event: "ValidatorCheckpointed", logs: logs, sub: sub}, nil +} + +// WatchValidatorCheckpointed is a free log subscription operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. +// +// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) WatchValidatorCheckpointed(opts *bind.WatchOpts, sink chan<- *IEigenPodValidatorCheckpointed, checkpointTimestamp []uint64, validatorIndex []*big.Int) (event.Subscription, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var validatorIndexRule []interface{} + for _, validatorIndexItem := range validatorIndex { + validatorIndexRule = append(validatorIndexRule, validatorIndexItem) + } + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "ValidatorCheckpointed", checkpointTimestampRule, validatorIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodValidatorCheckpointed) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorCheckpointed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseValidatorCheckpointed is a log parse operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. +// +// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) ParseValidatorCheckpointed(log types.Log) (*IEigenPodValidatorCheckpointed, error) { + event := new(IEigenPodValidatorCheckpointed) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorCheckpointed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodValidatorRestakedIterator is returned from FilterValidatorRestaked and is used to iterate over the raw logs and unpacked data for ValidatorRestaked events raised by the IEigenPod contract. +type IEigenPodValidatorRestakedIterator struct { + Event *IEigenPodValidatorRestaked // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodValidatorRestakedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorRestaked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorRestaked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodValidatorRestakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodValidatorRestakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodValidatorRestaked represents a ValidatorRestaked event raised by the IEigenPod contract. +type IEigenPodValidatorRestaked struct { + ValidatorIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorRestaked is a free log retrieval operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. +// +// Solidity: event ValidatorRestaked(uint40 validatorIndex) +func (_IEigenPod *IEigenPodFilterer) FilterValidatorRestaked(opts *bind.FilterOpts) (*IEigenPodValidatorRestakedIterator, error) { + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "ValidatorRestaked") + if err != nil { + return nil, err + } + return &IEigenPodValidatorRestakedIterator{contract: _IEigenPod.contract, event: "ValidatorRestaked", logs: logs, sub: sub}, nil +} + +// WatchValidatorRestaked is a free log subscription operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. +// +// Solidity: event ValidatorRestaked(uint40 validatorIndex) +func (_IEigenPod *IEigenPodFilterer) WatchValidatorRestaked(opts *bind.WatchOpts, sink chan<- *IEigenPodValidatorRestaked) (event.Subscription, error) { + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "ValidatorRestaked") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodValidatorRestaked) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorRestaked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseValidatorRestaked is a log parse operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. +// +// Solidity: event ValidatorRestaked(uint40 validatorIndex) +func (_IEigenPod *IEigenPodFilterer) ParseValidatorRestaked(log types.Log) (*IEigenPodValidatorRestaked, error) { + event := new(IEigenPodValidatorRestaked) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorRestaked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodValidatorWithdrawnIterator is returned from FilterValidatorWithdrawn and is used to iterate over the raw logs and unpacked data for ValidatorWithdrawn events raised by the IEigenPod contract. +type IEigenPodValidatorWithdrawnIterator struct { + Event *IEigenPodValidatorWithdrawn // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodValidatorWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodValidatorWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodValidatorWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodValidatorWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodValidatorWithdrawn represents a ValidatorWithdrawn event raised by the IEigenPod contract. +type IEigenPodValidatorWithdrawn struct { + CheckpointTimestamp uint64 + ValidatorIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterValidatorWithdrawn is a free log retrieval operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. +// +// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) FilterValidatorWithdrawn(opts *bind.FilterOpts, checkpointTimestamp []uint64, validatorIndex []*big.Int) (*IEigenPodValidatorWithdrawnIterator, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var validatorIndexRule []interface{} + for _, validatorIndexItem := range validatorIndex { + validatorIndexRule = append(validatorIndexRule, validatorIndexItem) + } + + logs, sub, err := _IEigenPod.contract.FilterLogs(opts, "ValidatorWithdrawn", checkpointTimestampRule, validatorIndexRule) + if err != nil { + return nil, err + } + return &IEigenPodValidatorWithdrawnIterator{contract: _IEigenPod.contract, event: "ValidatorWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchValidatorWithdrawn is a free log subscription operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. +// +// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) WatchValidatorWithdrawn(opts *bind.WatchOpts, sink chan<- *IEigenPodValidatorWithdrawn, checkpointTimestamp []uint64, validatorIndex []*big.Int) (event.Subscription, error) { + + var checkpointTimestampRule []interface{} + for _, checkpointTimestampItem := range checkpointTimestamp { + checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) + } + var validatorIndexRule []interface{} + for _, validatorIndexItem := range validatorIndex { + validatorIndexRule = append(validatorIndexRule, validatorIndexItem) + } + + logs, sub, err := _IEigenPod.contract.WatchLogs(opts, "ValidatorWithdrawn", checkpointTimestampRule, validatorIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodValidatorWithdrawn) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorWithdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseValidatorWithdrawn is a log parse operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. +// +// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) +func (_IEigenPod *IEigenPodFilterer) ParseValidatorWithdrawn(log types.Log) (*IEigenPodValidatorWithdrawn, error) { + event := new(IEigenPodValidatorWithdrawn) + if err := _IEigenPod.contract.UnpackLog(event, "ValidatorWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/chainio/clients/eigenpod/bindings/IEigenPodManager.go b/chainio/clients/eigenpod/bindings/IEigenPodManager.go new file mode 100644 index 00000000..6bd18db3 --- /dev/null +++ b/chainio/clients/eigenpod/bindings/IEigenPodManager.go @@ -0,0 +1,1956 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// IEigenPodManagerMetaData contains all meta data concerning the IEigenPodManager contract. +var IEigenPodManagerMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pauseAll\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pauserRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"podOwnerShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PauserRegistrySet\",\"inputs\":[{\"name\":\"pauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", +} + +// IEigenPodManagerABI is the input ABI used to generate the binding from. +// Deprecated: Use IEigenPodManagerMetaData.ABI instead. +var IEigenPodManagerABI = IEigenPodManagerMetaData.ABI + +// IEigenPodManager is an auto generated Go binding around an Ethereum contract. +type IEigenPodManager struct { + IEigenPodManagerCaller // Read-only binding to the contract + IEigenPodManagerTransactor // Write-only binding to the contract + IEigenPodManagerFilterer // Log filterer for contract events +} + +// IEigenPodManagerCaller is an auto generated read-only Go binding around an Ethereum contract. +type IEigenPodManagerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type IEigenPodManagerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type IEigenPodManagerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// IEigenPodManagerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type IEigenPodManagerSession struct { + Contract *IEigenPodManager // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IEigenPodManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type IEigenPodManagerCallerSession struct { + Contract *IEigenPodManagerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// IEigenPodManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type IEigenPodManagerTransactorSession struct { + Contract *IEigenPodManagerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// IEigenPodManagerRaw is an auto generated low-level Go binding around an Ethereum contract. +type IEigenPodManagerRaw struct { + Contract *IEigenPodManager // Generic contract binding to access the raw methods on +} + +// IEigenPodManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type IEigenPodManagerCallerRaw struct { + Contract *IEigenPodManagerCaller // Generic read-only contract binding to access the raw methods on +} + +// IEigenPodManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type IEigenPodManagerTransactorRaw struct { + Contract *IEigenPodManagerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewIEigenPodManager creates a new instance of IEigenPodManager, bound to a specific deployed contract. +func NewIEigenPodManager(address common.Address, backend bind.ContractBackend) (*IEigenPodManager, error) { + contract, err := bindIEigenPodManager(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &IEigenPodManager{IEigenPodManagerCaller: IEigenPodManagerCaller{contract: contract}, IEigenPodManagerTransactor: IEigenPodManagerTransactor{contract: contract}, IEigenPodManagerFilterer: IEigenPodManagerFilterer{contract: contract}}, nil +} + +// NewIEigenPodManagerCaller creates a new read-only instance of IEigenPodManager, bound to a specific deployed contract. +func NewIEigenPodManagerCaller(address common.Address, caller bind.ContractCaller) (*IEigenPodManagerCaller, error) { + contract, err := bindIEigenPodManager(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &IEigenPodManagerCaller{contract: contract}, nil +} + +// NewIEigenPodManagerTransactor creates a new write-only instance of IEigenPodManager, bound to a specific deployed contract. +func NewIEigenPodManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*IEigenPodManagerTransactor, error) { + contract, err := bindIEigenPodManager(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &IEigenPodManagerTransactor{contract: contract}, nil +} + +// NewIEigenPodManagerFilterer creates a new log filterer instance of IEigenPodManager, bound to a specific deployed contract. +func NewIEigenPodManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*IEigenPodManagerFilterer, error) { + contract, err := bindIEigenPodManager(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &IEigenPodManagerFilterer{contract: contract}, nil +} + +// bindIEigenPodManager binds a generic wrapper to an already deployed contract. +func bindIEigenPodManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := IEigenPodManagerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IEigenPodManager *IEigenPodManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IEigenPodManager.Contract.IEigenPodManagerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IEigenPodManager *IEigenPodManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPodManager.Contract.IEigenPodManagerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IEigenPodManager *IEigenPodManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IEigenPodManager.Contract.IEigenPodManagerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_IEigenPodManager *IEigenPodManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _IEigenPodManager.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_IEigenPodManager *IEigenPodManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPodManager.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_IEigenPodManager *IEigenPodManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _IEigenPodManager.Contract.contract.Transact(opts, method, params...) +} + +// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. +// +// Solidity: function beaconChainETHStrategy() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) BeaconChainETHStrategy(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "beaconChainETHStrategy") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. +// +// Solidity: function beaconChainETHStrategy() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) BeaconChainETHStrategy() (common.Address, error) { + return _IEigenPodManager.Contract.BeaconChainETHStrategy(&_IEigenPodManager.CallOpts) +} + +// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. +// +// Solidity: function beaconChainETHStrategy() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) BeaconChainETHStrategy() (common.Address, error) { + return _IEigenPodManager.Contract.BeaconChainETHStrategy(&_IEigenPodManager.CallOpts) +} + +// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. +// +// Solidity: function eigenPodBeacon() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) EigenPodBeacon(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "eigenPodBeacon") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. +// +// Solidity: function eigenPodBeacon() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) EigenPodBeacon() (common.Address, error) { + return _IEigenPodManager.Contract.EigenPodBeacon(&_IEigenPodManager.CallOpts) +} + +// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. +// +// Solidity: function eigenPodBeacon() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) EigenPodBeacon() (common.Address, error) { + return _IEigenPodManager.Contract.EigenPodBeacon(&_IEigenPodManager.CallOpts) +} + +// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. +// +// Solidity: function ethPOS() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) EthPOS(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "ethPOS") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. +// +// Solidity: function ethPOS() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) EthPOS() (common.Address, error) { + return _IEigenPodManager.Contract.EthPOS(&_IEigenPodManager.CallOpts) +} + +// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. +// +// Solidity: function ethPOS() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) EthPOS() (common.Address, error) { + return _IEigenPodManager.Contract.EthPOS(&_IEigenPodManager.CallOpts) +} + +// GetPod is a free data retrieval call binding the contract method 0xa38406a3. +// +// Solidity: function getPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) GetPod(opts *bind.CallOpts, podOwner common.Address) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "getPod", podOwner) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetPod is a free data retrieval call binding the contract method 0xa38406a3. +// +// Solidity: function getPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) GetPod(podOwner common.Address) (common.Address, error) { + return _IEigenPodManager.Contract.GetPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// GetPod is a free data retrieval call binding the contract method 0xa38406a3. +// +// Solidity: function getPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) GetPod(podOwner common.Address) (common.Address, error) { + return _IEigenPodManager.Contract.GetPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// HasPod is a free data retrieval call binding the contract method 0xf6848d24. +// +// Solidity: function hasPod(address podOwner) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerCaller) HasPod(opts *bind.CallOpts, podOwner common.Address) (bool, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "hasPod", podOwner) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// HasPod is a free data retrieval call binding the contract method 0xf6848d24. +// +// Solidity: function hasPod(address podOwner) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerSession) HasPod(podOwner common.Address) (bool, error) { + return _IEigenPodManager.Contract.HasPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// HasPod is a free data retrieval call binding the contract method 0xf6848d24. +// +// Solidity: function hasPod(address podOwner) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerCallerSession) HasPod(podOwner common.Address) (bool, error) { + return _IEigenPodManager.Contract.HasPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// NumPods is a free data retrieval call binding the contract method 0xa6a509be. +// +// Solidity: function numPods() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerCaller) NumPods(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "numPods") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumPods is a free data retrieval call binding the contract method 0xa6a509be. +// +// Solidity: function numPods() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerSession) NumPods() (*big.Int, error) { + return _IEigenPodManager.Contract.NumPods(&_IEigenPodManager.CallOpts) +} + +// NumPods is a free data retrieval call binding the contract method 0xa6a509be. +// +// Solidity: function numPods() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerCallerSession) NumPods() (*big.Int, error) { + return _IEigenPodManager.Contract.NumPods(&_IEigenPodManager.CallOpts) +} + +// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. +// +// Solidity: function ownerToPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) OwnerToPod(opts *bind.CallOpts, podOwner common.Address) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "ownerToPod", podOwner) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. +// +// Solidity: function ownerToPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) OwnerToPod(podOwner common.Address) (common.Address, error) { + return _IEigenPodManager.Contract.OwnerToPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. +// +// Solidity: function ownerToPod(address podOwner) view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) OwnerToPod(podOwner common.Address) (common.Address, error) { + return _IEigenPodManager.Contract.OwnerToPod(&_IEigenPodManager.CallOpts, podOwner) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerCaller) Paused(opts *bind.CallOpts, index uint8) (bool, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "paused", index) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerSession) Paused(index uint8) (bool, error) { + return _IEigenPodManager.Contract.Paused(&_IEigenPodManager.CallOpts, index) +} + +// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. +// +// Solidity: function paused(uint8 index) view returns(bool) +func (_IEigenPodManager *IEigenPodManagerCallerSession) Paused(index uint8) (bool, error) { + return _IEigenPodManager.Contract.Paused(&_IEigenPodManager.CallOpts, index) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerCaller) Paused0(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "paused0") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerSession) Paused0() (*big.Int, error) { + return _IEigenPodManager.Contract.Paused0(&_IEigenPodManager.CallOpts) +} + +// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(uint256) +func (_IEigenPodManager *IEigenPodManagerCallerSession) Paused0() (*big.Int, error) { + return _IEigenPodManager.Contract.Paused0(&_IEigenPodManager.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) PauserRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "pauserRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) PauserRegistry() (common.Address, error) { + return _IEigenPodManager.Contract.PauserRegistry(&_IEigenPodManager.CallOpts) +} + +// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. +// +// Solidity: function pauserRegistry() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) PauserRegistry() (common.Address, error) { + return _IEigenPodManager.Contract.PauserRegistry(&_IEigenPodManager.CallOpts) +} + +// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. +// +// Solidity: function podOwnerShares(address podOwner) view returns(int256) +func (_IEigenPodManager *IEigenPodManagerCaller) PodOwnerShares(opts *bind.CallOpts, podOwner common.Address) (*big.Int, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "podOwnerShares", podOwner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. +// +// Solidity: function podOwnerShares(address podOwner) view returns(int256) +func (_IEigenPodManager *IEigenPodManagerSession) PodOwnerShares(podOwner common.Address) (*big.Int, error) { + return _IEigenPodManager.Contract.PodOwnerShares(&_IEigenPodManager.CallOpts, podOwner) +} + +// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. +// +// Solidity: function podOwnerShares(address podOwner) view returns(int256) +func (_IEigenPodManager *IEigenPodManagerCallerSession) PodOwnerShares(podOwner common.Address) (*big.Int, error) { + return _IEigenPodManager.Contract.PodOwnerShares(&_IEigenPodManager.CallOpts, podOwner) +} + +// Slasher is a free data retrieval call binding the contract method 0xb1344271. +// +// Solidity: function slasher() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) Slasher(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "slasher") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Slasher is a free data retrieval call binding the contract method 0xb1344271. +// +// Solidity: function slasher() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) Slasher() (common.Address, error) { + return _IEigenPodManager.Contract.Slasher(&_IEigenPodManager.CallOpts) +} + +// Slasher is a free data retrieval call binding the contract method 0xb1344271. +// +// Solidity: function slasher() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) Slasher() (common.Address, error) { + return _IEigenPodManager.Contract.Slasher(&_IEigenPodManager.CallOpts) +} + +// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. +// +// Solidity: function strategyManager() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCaller) StrategyManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _IEigenPodManager.contract.Call(opts, &out, "strategyManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. +// +// Solidity: function strategyManager() view returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) StrategyManager() (common.Address, error) { + return _IEigenPodManager.Contract.StrategyManager(&_IEigenPodManager.CallOpts) +} + +// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. +// +// Solidity: function strategyManager() view returns(address) +func (_IEigenPodManager *IEigenPodManagerCallerSession) StrategyManager() (common.Address, error) { + return _IEigenPodManager.Contract.StrategyManager(&_IEigenPodManager.CallOpts) +} + +// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. +// +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +func (_IEigenPodManager *IEigenPodManagerTransactor) AddShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "addShares", podOwner, shares) +} + +// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. +// +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +func (_IEigenPodManager *IEigenPodManagerSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.AddShares(&_IEigenPodManager.TransactOpts, podOwner, shares) +} + +// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. +// +// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) +func (_IEigenPodManager *IEigenPodManagerTransactorSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.AddShares(&_IEigenPodManager.TransactOpts, podOwner, shares) +} + +// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. +// +// Solidity: function createPod() returns(address) +func (_IEigenPodManager *IEigenPodManagerTransactor) CreatePod(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "createPod") +} + +// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. +// +// Solidity: function createPod() returns(address) +func (_IEigenPodManager *IEigenPodManagerSession) CreatePod() (*types.Transaction, error) { + return _IEigenPodManager.Contract.CreatePod(&_IEigenPodManager.TransactOpts) +} + +// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. +// +// Solidity: function createPod() returns(address) +func (_IEigenPodManager *IEigenPodManagerTransactorSession) CreatePod() (*types.Transaction, error) { + return _IEigenPodManager.Contract.CreatePod(&_IEigenPodManager.TransactOpts) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) Pause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "pause", newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Pause(&_IEigenPodManager.TransactOpts, newPausedStatus) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Pause(&_IEigenPodManager.TransactOpts, newPausedStatus) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) PauseAll(opts *bind.TransactOpts) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "pauseAll") +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_IEigenPodManager *IEigenPodManagerSession) PauseAll() (*types.Transaction, error) { + return _IEigenPodManager.Contract.PauseAll(&_IEigenPodManager.TransactOpts) +} + +// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. +// +// Solidity: function pauseAll() returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) PauseAll() (*types.Transaction, error) { + return _IEigenPodManager.Contract.PauseAll(&_IEigenPodManager.TransactOpts) +} + +// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. +// +// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) RecordBeaconChainETHBalanceUpdate(opts *bind.TransactOpts, podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "recordBeaconChainETHBalanceUpdate", podOwner, sharesDelta) +} + +// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. +// +// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() +func (_IEigenPodManager *IEigenPodManagerSession) RecordBeaconChainETHBalanceUpdate(podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.RecordBeaconChainETHBalanceUpdate(&_IEigenPodManager.TransactOpts, podOwner, sharesDelta) +} + +// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. +// +// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) RecordBeaconChainETHBalanceUpdate(podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.RecordBeaconChainETHBalanceUpdate(&_IEigenPodManager.TransactOpts, podOwner, sharesDelta) +} + +// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. +// +// Solidity: function removeShares(address podOwner, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) RemoveShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "removeShares", podOwner, shares) +} + +// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. +// +// Solidity: function removeShares(address podOwner, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerSession) RemoveShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.RemoveShares(&_IEigenPodManager.TransactOpts, podOwner, shares) +} + +// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. +// +// Solidity: function removeShares(address podOwner, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) RemoveShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.RemoveShares(&_IEigenPodManager.TransactOpts, podOwner, shares) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) SetPauserRegistry(opts *bind.TransactOpts, newPauserRegistry common.Address) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "setPauserRegistry", newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_IEigenPodManager *IEigenPodManagerSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _IEigenPodManager.Contract.SetPauserRegistry(&_IEigenPodManager.TransactOpts, newPauserRegistry) +} + +// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. +// +// Solidity: function setPauserRegistry(address newPauserRegistry) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { + return _IEigenPodManager.Contract.SetPauserRegistry(&_IEigenPodManager.TransactOpts, newPauserRegistry) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) Stake(opts *bind.TransactOpts, pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "stake", pubkey, signature, depositDataRoot) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPodManager *IEigenPodManagerSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Stake(&_IEigenPodManager.TransactOpts, pubkey, signature, depositDataRoot) +} + +// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. +// +// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Stake(&_IEigenPodManager.TransactOpts, pubkey, signature, depositDataRoot) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) Unpause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "unpause", newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Unpause(&_IEigenPodManager.TransactOpts, newPausedStatus) +} + +// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. +// +// Solidity: function unpause(uint256 newPausedStatus) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.Unpause(&_IEigenPodManager.TransactOpts, newPausedStatus) +} + +// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. +// +// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerTransactor) WithdrawSharesAsTokens(opts *bind.TransactOpts, podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.contract.Transact(opts, "withdrawSharesAsTokens", podOwner, destination, shares) +} + +// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. +// +// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerSession) WithdrawSharesAsTokens(podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.WithdrawSharesAsTokens(&_IEigenPodManager.TransactOpts, podOwner, destination, shares) +} + +// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. +// +// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() +func (_IEigenPodManager *IEigenPodManagerTransactorSession) WithdrawSharesAsTokens(podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { + return _IEigenPodManager.Contract.WithdrawSharesAsTokens(&_IEigenPodManager.TransactOpts, podOwner, destination, shares) +} + +// IEigenPodManagerBeaconChainETHDepositedIterator is returned from FilterBeaconChainETHDeposited and is used to iterate over the raw logs and unpacked data for BeaconChainETHDeposited events raised by the IEigenPodManager contract. +type IEigenPodManagerBeaconChainETHDepositedIterator struct { + Event *IEigenPodManagerBeaconChainETHDeposited // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerBeaconChainETHDepositedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerBeaconChainETHDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerBeaconChainETHDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerBeaconChainETHDepositedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerBeaconChainETHDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerBeaconChainETHDeposited represents a BeaconChainETHDeposited event raised by the IEigenPodManager contract. +type IEigenPodManagerBeaconChainETHDeposited struct { + PodOwner common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconChainETHDeposited is a free log retrieval operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. +// +// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterBeaconChainETHDeposited(opts *bind.FilterOpts, podOwner []common.Address) (*IEigenPodManagerBeaconChainETHDepositedIterator, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "BeaconChainETHDeposited", podOwnerRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerBeaconChainETHDepositedIterator{contract: _IEigenPodManager.contract, event: "BeaconChainETHDeposited", logs: logs, sub: sub}, nil +} + +// WatchBeaconChainETHDeposited is a free log subscription operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. +// +// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchBeaconChainETHDeposited(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerBeaconChainETHDeposited, podOwner []common.Address) (event.Subscription, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "BeaconChainETHDeposited", podOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerBeaconChainETHDeposited) + if err := _IEigenPodManager.contract.UnpackLog(event, "BeaconChainETHDeposited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeaconChainETHDeposited is a log parse operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. +// +// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParseBeaconChainETHDeposited(log types.Log) (*IEigenPodManagerBeaconChainETHDeposited, error) { + event := new(IEigenPodManagerBeaconChainETHDeposited) + if err := _IEigenPodManager.contract.UnpackLog(event, "BeaconChainETHDeposited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator is returned from FilterBeaconChainETHWithdrawalCompleted and is used to iterate over the raw logs and unpacked data for BeaconChainETHWithdrawalCompleted events raised by the IEigenPodManager contract. +type IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator struct { + Event *IEigenPodManagerBeaconChainETHWithdrawalCompleted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerBeaconChainETHWithdrawalCompleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerBeaconChainETHWithdrawalCompleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerBeaconChainETHWithdrawalCompleted represents a BeaconChainETHWithdrawalCompleted event raised by the IEigenPodManager contract. +type IEigenPodManagerBeaconChainETHWithdrawalCompleted struct { + PodOwner common.Address + Shares *big.Int + Nonce *big.Int + DelegatedAddress common.Address + Withdrawer common.Address + WithdrawalRoot [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconChainETHWithdrawalCompleted is a free log retrieval operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. +// +// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterBeaconChainETHWithdrawalCompleted(opts *bind.FilterOpts, podOwner []common.Address) (*IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "BeaconChainETHWithdrawalCompleted", podOwnerRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerBeaconChainETHWithdrawalCompletedIterator{contract: _IEigenPodManager.contract, event: "BeaconChainETHWithdrawalCompleted", logs: logs, sub: sub}, nil +} + +// WatchBeaconChainETHWithdrawalCompleted is a free log subscription operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. +// +// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchBeaconChainETHWithdrawalCompleted(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerBeaconChainETHWithdrawalCompleted, podOwner []common.Address) (event.Subscription, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "BeaconChainETHWithdrawalCompleted", podOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerBeaconChainETHWithdrawalCompleted) + if err := _IEigenPodManager.contract.UnpackLog(event, "BeaconChainETHWithdrawalCompleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeaconChainETHWithdrawalCompleted is a log parse operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. +// +// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParseBeaconChainETHWithdrawalCompleted(log types.Log) (*IEigenPodManagerBeaconChainETHWithdrawalCompleted, error) { + event := new(IEigenPodManagerBeaconChainETHWithdrawalCompleted) + if err := _IEigenPodManager.contract.UnpackLog(event, "BeaconChainETHWithdrawalCompleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerNewTotalSharesIterator is returned from FilterNewTotalShares and is used to iterate over the raw logs and unpacked data for NewTotalShares events raised by the IEigenPodManager contract. +type IEigenPodManagerNewTotalSharesIterator struct { + Event *IEigenPodManagerNewTotalShares // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerNewTotalSharesIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerNewTotalShares) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerNewTotalShares) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerNewTotalSharesIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerNewTotalSharesIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerNewTotalShares represents a NewTotalShares event raised by the IEigenPodManager contract. +type IEigenPodManagerNewTotalShares struct { + PodOwner common.Address + NewTotalShares *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewTotalShares is a free log retrieval operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. +// +// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterNewTotalShares(opts *bind.FilterOpts, podOwner []common.Address) (*IEigenPodManagerNewTotalSharesIterator, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "NewTotalShares", podOwnerRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerNewTotalSharesIterator{contract: _IEigenPodManager.contract, event: "NewTotalShares", logs: logs, sub: sub}, nil +} + +// WatchNewTotalShares is a free log subscription operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. +// +// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchNewTotalShares(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerNewTotalShares, podOwner []common.Address) (event.Subscription, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "NewTotalShares", podOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerNewTotalShares) + if err := _IEigenPodManager.contract.UnpackLog(event, "NewTotalShares", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewTotalShares is a log parse operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. +// +// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParseNewTotalShares(log types.Log) (*IEigenPodManagerNewTotalShares, error) { + event := new(IEigenPodManagerNewTotalShares) + if err := _IEigenPodManager.contract.UnpackLog(event, "NewTotalShares", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the IEigenPodManager contract. +type IEigenPodManagerPausedIterator struct { + Event *IEigenPodManagerPaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerPausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerPaused represents a Paused event raised by the IEigenPodManager contract. +type IEigenPodManagerPaused struct { + Account common.Address + NewPausedStatus *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterPaused(opts *bind.FilterOpts, account []common.Address) (*IEigenPodManagerPausedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "Paused", accountRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerPausedIterator{contract: _IEigenPodManager.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerPaused, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "Paused", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerPaused) + if err := _IEigenPodManager.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePaused is a log parse operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. +// +// Solidity: event Paused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParsePaused(log types.Log) (*IEigenPodManagerPaused, error) { + event := new(IEigenPodManagerPaused) + if err := _IEigenPodManager.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerPauserRegistrySetIterator is returned from FilterPauserRegistrySet and is used to iterate over the raw logs and unpacked data for PauserRegistrySet events raised by the IEigenPodManager contract. +type IEigenPodManagerPauserRegistrySetIterator struct { + Event *IEigenPodManagerPauserRegistrySet // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerPauserRegistrySetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPauserRegistrySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPauserRegistrySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerPauserRegistrySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerPauserRegistrySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerPauserRegistrySet represents a PauserRegistrySet event raised by the IEigenPodManager contract. +type IEigenPodManagerPauserRegistrySet struct { + PauserRegistry common.Address + NewPauserRegistry common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPauserRegistrySet is a free log retrieval operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterPauserRegistrySet(opts *bind.FilterOpts) (*IEigenPodManagerPauserRegistrySetIterator, error) { + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "PauserRegistrySet") + if err != nil { + return nil, err + } + return &IEigenPodManagerPauserRegistrySetIterator{contract: _IEigenPodManager.contract, event: "PauserRegistrySet", logs: logs, sub: sub}, nil +} + +// WatchPauserRegistrySet is a free log subscription operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchPauserRegistrySet(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerPauserRegistrySet) (event.Subscription, error) { + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "PauserRegistrySet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerPauserRegistrySet) + if err := _IEigenPodManager.contract.UnpackLog(event, "PauserRegistrySet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePauserRegistrySet is a log parse operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. +// +// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParsePauserRegistrySet(log types.Log) (*IEigenPodManagerPauserRegistrySet, error) { + event := new(IEigenPodManagerPauserRegistrySet) + if err := _IEigenPodManager.contract.UnpackLog(event, "PauserRegistrySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerPodDeployedIterator is returned from FilterPodDeployed and is used to iterate over the raw logs and unpacked data for PodDeployed events raised by the IEigenPodManager contract. +type IEigenPodManagerPodDeployedIterator struct { + Event *IEigenPodManagerPodDeployed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerPodDeployedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPodDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPodDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerPodDeployedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerPodDeployedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerPodDeployed represents a PodDeployed event raised by the IEigenPodManager contract. +type IEigenPodManagerPodDeployed struct { + EigenPod common.Address + PodOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPodDeployed is a free log retrieval operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. +// +// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterPodDeployed(opts *bind.FilterOpts, eigenPod []common.Address, podOwner []common.Address) (*IEigenPodManagerPodDeployedIterator, error) { + + var eigenPodRule []interface{} + for _, eigenPodItem := range eigenPod { + eigenPodRule = append(eigenPodRule, eigenPodItem) + } + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "PodDeployed", eigenPodRule, podOwnerRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerPodDeployedIterator{contract: _IEigenPodManager.contract, event: "PodDeployed", logs: logs, sub: sub}, nil +} + +// WatchPodDeployed is a free log subscription operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. +// +// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchPodDeployed(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerPodDeployed, eigenPod []common.Address, podOwner []common.Address) (event.Subscription, error) { + + var eigenPodRule []interface{} + for _, eigenPodItem := range eigenPod { + eigenPodRule = append(eigenPodRule, eigenPodItem) + } + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "PodDeployed", eigenPodRule, podOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerPodDeployed) + if err := _IEigenPodManager.contract.UnpackLog(event, "PodDeployed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePodDeployed is a log parse operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. +// +// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParsePodDeployed(log types.Log) (*IEigenPodManagerPodDeployed, error) { + event := new(IEigenPodManagerPodDeployed) + if err := _IEigenPodManager.contract.UnpackLog(event, "PodDeployed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerPodSharesUpdatedIterator is returned from FilterPodSharesUpdated and is used to iterate over the raw logs and unpacked data for PodSharesUpdated events raised by the IEigenPodManager contract. +type IEigenPodManagerPodSharesUpdatedIterator struct { + Event *IEigenPodManagerPodSharesUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerPodSharesUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPodSharesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerPodSharesUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerPodSharesUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerPodSharesUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerPodSharesUpdated represents a PodSharesUpdated event raised by the IEigenPodManager contract. +type IEigenPodManagerPodSharesUpdated struct { + PodOwner common.Address + SharesDelta *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPodSharesUpdated is a free log retrieval operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. +// +// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterPodSharesUpdated(opts *bind.FilterOpts, podOwner []common.Address) (*IEigenPodManagerPodSharesUpdatedIterator, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "PodSharesUpdated", podOwnerRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerPodSharesUpdatedIterator{contract: _IEigenPodManager.contract, event: "PodSharesUpdated", logs: logs, sub: sub}, nil +} + +// WatchPodSharesUpdated is a free log subscription operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. +// +// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchPodSharesUpdated(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerPodSharesUpdated, podOwner []common.Address) (event.Subscription, error) { + + var podOwnerRule []interface{} + for _, podOwnerItem := range podOwner { + podOwnerRule = append(podOwnerRule, podOwnerItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "PodSharesUpdated", podOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerPodSharesUpdated) + if err := _IEigenPodManager.contract.UnpackLog(event, "PodSharesUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePodSharesUpdated is a log parse operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. +// +// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParsePodSharesUpdated(log types.Log) (*IEigenPodManagerPodSharesUpdated, error) { + event := new(IEigenPodManagerPodSharesUpdated) + if err := _IEigenPodManager.contract.UnpackLog(event, "PodSharesUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// IEigenPodManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the IEigenPodManager contract. +type IEigenPodManagerUnpausedIterator struct { + Event *IEigenPodManagerUnpaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEigenPodManagerUnpausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEigenPodManagerUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEigenPodManagerUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEigenPodManagerUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEigenPodManagerUnpaused represents a Unpaused event raised by the IEigenPodManager contract. +type IEigenPodManagerUnpaused struct { + Account common.Address + NewPausedStatus *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) FilterUnpaused(opts *bind.FilterOpts, account []common.Address) (*IEigenPodManagerUnpausedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _IEigenPodManager.contract.FilterLogs(opts, "Unpaused", accountRule) + if err != nil { + return nil, err + } + return &IEigenPodManagerUnpausedIterator{contract: _IEigenPodManager.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *IEigenPodManagerUnpaused, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _IEigenPodManager.contract.WatchLogs(opts, "Unpaused", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEigenPodManagerUnpaused) + if err := _IEigenPodManager.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnpaused is a log parse operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. +// +// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) +func (_IEigenPodManager *IEigenPodManagerFilterer) ParseUnpaused(log types.Log) (*IEigenPodManagerUnpaused, error) { + event := new(IEigenPodManagerUnpaused) + if err := _IEigenPodManager.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/chainio/clients/eigenpod/builder.go b/chainio/clients/eigenpod/builder.go new file mode 100644 index 00000000..f1ba7bdf --- /dev/null +++ b/chainio/clients/eigenpod/builder.go @@ -0,0 +1,64 @@ +package eigenpod + +import ( + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" + "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/utils" + + "github.com/ethereum/go-ethereum/common" +) + +func BuildEigenPodClients( + address common.Address, + client eth.HttpBackend, + txMgr txmgr.TxManager, + logger logging.Logger, +) (*ChainReader, *ChainWriter, *ContractBindings, error) { + eigenPodBindings, err := NewContractBindings(address, client) + if err != nil { + return nil, nil, nil, utils.WrapError("failed to create EigenPod contract bindings", err) + } + + eigenPodChainReader := newChainReader( + &eigenPodBindings.IEigenPodCaller, + client, + logger, + ) + + eigenPodChainWriter := newChainWriter( + eigenPodBindings.IEigenPod, + client, + logger, + txMgr, + ) + + return eigenPodChainReader, eigenPodChainWriter, eigenPodBindings, nil +} + +func BuildEigenPodManagerClients( + address common.Address, + client eth.HttpBackend, + txMgr txmgr.TxManager, + logger logging.Logger, +) (*ManagerChainReader, *ManagerChainWriter, *ManagerContractBindings, error) { + eigenPodManagerBindings, err := NewManagerContractBindings(address, client) + if err != nil { + return nil, nil, nil, utils.WrapError("failed to create EigenPod manager contract bindings", err) + } + + eigenPodManagerChainReader := newManagerChainReader( + &eigenPodManagerBindings.IEigenPodManagerCaller, + client, + logger, + ) + + eigenPodManagerChainWriter := newManagerChainWriter( + eigenPodManagerBindings.IEigenPodManager, + client, + logger, + txMgr, + ) + + return eigenPodManagerChainReader, eigenPodManagerChainWriter, eigenPodManagerBindings, nil +} diff --git a/chainio/clients/eigenpod/generate.sh b/chainio/clients/eigenpod/generate.sh new file mode 100755 index 00000000..32297ed3 --- /dev/null +++ b/chainio/clients/eigenpod/generate.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# This script generates Go bindings for the EigenPods contracts +# The reason this script is separate from the bindings generation in the ~/contracts directory +# is because they are in a separate branch in eigenlayer-contracts and to unblock the development +# of the EigenPods client, we need to generate the bindings for the contracts in the feat/partial-withdrawal-batching branch. +# Once eigenlayer-contracts repo is stable and features are on single branch, we can move the bindings back to normal process + +TMP_DIR=$(mktemp -d) +BINDINGS_DIR=bindings + +cleanup_bindings_dir() { + echo "Cleaning up the bindings directory" + rm -rf ${BINDINGS_DIR} +} + +clone() { + echo "Cloning the EigenLayer contracts repository" + git clone -b feat/partial-withdrawal-batching --depth=1 git@github.com:Layr-Labs/eigenlayer-contracts.git "${TMP_DIR}" +} + +generate_bindings() { + echo "Generating bindings for the EigenPods contracts" + current_dir=$(pwd) + cd "${TMP_DIR}" && make bindings + # shellcheck disable=SC2164 + cd "$current_dir" + mkdir -p ${BINDINGS_DIR} + generate_go "${TMP_DIR}"/out/IEigenPod.sol/IEigenPod.json IEigenPod + generate_go "${TMP_DIR}"/out/IEigenPodManager.sol/IEigenPodManager.json IEigenPodManager +} + +generate_go() { + # Check if jq is installed + if ! command -v jq &> /dev/null; then + echo "jq is required but not installed. Please install jq (brew install jq)." + exit 1 + fi + + temp_file=$(mktemp) + echo "Generating Go bindings for the $1 contract" + jq '.abi' "$1" > "$temp_file" && mv "$temp_file" "$1" + + abigen --abi "$1" --pkg bindings --type "$2" --out "$BINDINGS_DIR"/"$2".go +} + +cleanup() { + echo "Cleaning up the temporary directory" + rm -rf "${TMP_DIR}" +} + +main() { + cleanup_bindings_dir + clone + generate_bindings + cleanup +} + +main \ No newline at end of file diff --git a/chainio/clients/eigenpod/reader.go b/chainio/clients/eigenpod/reader.go new file mode 100644 index 00000000..8d47c61b --- /dev/null +++ b/chainio/clients/eigenpod/reader.go @@ -0,0 +1,82 @@ +package eigenpod + +import ( + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eigenpod/bindings" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/utils" + + "github.com/ethereum/go-ethereum/common" +) + +// ChainReader is a reader for the EigenPod contract. +// We want it to be different from the ManagerChainReader since as a user, +// I only need this reader to manage my EigenPod. So there's no need for ManagerChainReader +type ChainReader struct { + logger logging.Logger + ethClient eth.HttpBackend + *bindings.IEigenPodCaller +} + +// ManagerChainReader is a reader for the EigenPodManager contract. +// We want it to be different from the ChainReader since as a user, this is only +// needed to get overall state of all the EigenPods in the system. +type ManagerChainReader struct { + logger logging.Logger + ethClient eth.HttpBackend + *bindings.IEigenPodManagerCaller +} + +func newChainReader( + eigenPod *bindings.IEigenPodCaller, + ethClient eth.HttpBackend, + logger logging.Logger, +) *ChainReader { + logger = logger.With(logging.ComponentKey, "eigenpod/reader") + + return &ChainReader{ + logger: logger, + ethClient: ethClient, + IEigenPodCaller: eigenPod, + } +} + +func newManagerChainReader( + manager *bindings.IEigenPodManagerCaller, + ethClient eth.HttpBackend, + logger logging.Logger, +) *ManagerChainReader { + logger = logger.With(logging.ComponentKey, "eigenpodmanager/reader") + + return &ManagerChainReader{ + logger: logger, + ethClient: ethClient, + IEigenPodManagerCaller: manager, + } +} + +func NewReader( + eigenPodAddress common.Address, + ethClient eth.HttpBackend, + logger logging.Logger, +) (*ChainReader, error) { + pod, err := NewContractCallerBindings(eigenPodAddress, ethClient) + if err != nil { + return nil, utils.WrapError("Failed to create EigenPod contract", err) + } + + return newChainReader(pod.IEigenPodCaller, ethClient, logger), nil +} + +func NewManagerReader( + eigenPodManagerAddress common.Address, + ethClient eth.HttpBackend, + logger logging.Logger, +) (*ManagerChainReader, error) { + manager, err := NewManagerContractCallerBindings(eigenPodManagerAddress, ethClient) + if err != nil { + return nil, utils.WrapError("Failed to create EigenPodManager contract", err) + } + + return newManagerChainReader(manager.IEigenPodManagerCaller, ethClient, logger), nil +} diff --git a/chainio/clients/eigenpod/writer.go b/chainio/clients/eigenpod/writer.go new file mode 100644 index 00000000..3ec18185 --- /dev/null +++ b/chainio/clients/eigenpod/writer.go @@ -0,0 +1,87 @@ +package eigenpod + +import ( + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eigenpod/bindings" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" + "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/utils" + + "github.com/ethereum/go-ethereum/common" +) + +type ChainWriter struct { + logger logging.Logger + ethClient eth.HttpBackend + eigenPod *bindings.IEigenPod + txMgr txmgr.TxManager +} + +type ManagerChainWriter struct { + logger logging.Logger + ethClient eth.HttpBackend + manager *bindings.IEigenPodManager + txMgr txmgr.TxManager +} + +func newChainWriter( + eigenPod *bindings.IEigenPod, + ethClient eth.HttpBackend, + logger logging.Logger, + txMgr txmgr.TxManager, +) *ChainWriter { + logger = logger.With(logging.ComponentKey, "eigenpod/writer") + + return &ChainWriter{ + logger: logger, + ethClient: ethClient, + eigenPod: eigenPod, + txMgr: txMgr, + } +} + +func newManagerChainWriter( + manager *bindings.IEigenPodManager, + ethClient eth.HttpBackend, + logger logging.Logger, + txMgr txmgr.TxManager, +) *ManagerChainWriter { + logger = logger.With(logging.ComponentKey, "eigenpodmanager/writer") + + return &ManagerChainWriter{ + logger: logger, + ethClient: ethClient, + manager: manager, + txMgr: txMgr, + } +} + +func NewWriter( + eigenPodAddress common.Address, + ethClient eth.HttpBackend, + txMgr txmgr.TxManager, + logger logging.Logger, +) (*ChainWriter, error) { + pod, err := bindings.NewIEigenPod(eigenPodAddress, ethClient) + if err != nil { + return nil, utils.WrapError("Failed to create EigenPod contract", err) + } + + return newChainWriter(pod, ethClient, logger, txMgr), nil +} + +func NewManagerWriter( + eigenPodManagerAddress common.Address, + ethClient eth.HttpBackend, + txMgr txmgr.TxManager, + logger logging.Logger, +) (*ManagerChainWriter, error) { + manager, err := bindings.NewIEigenPodManager(eigenPodManagerAddress, ethClient) + if err != nil { + return nil, utils.WrapError("Failed to create EigenPodManager contract", err) + } + + return newManagerChainWriter(manager, ethClient, logger, txMgr), nil +} + +// TODO(madhur): Add methods to ChainWriter and ManagerChainWriter to interact with the contracts. diff --git a/chainio/clients/elcontracts/bindings.go b/chainio/clients/elcontracts/bindings.go index 2eaad8bb..487ec2c3 100644 --- a/chainio/clients/elcontracts/bindings.go +++ b/chainio/clients/elcontracts/bindings.go @@ -35,7 +35,7 @@ type ContractBindings struct { func NewBindingsFromConfig( cfg Config, - client eth.Client, + client eth.HttpBackend, logger logging.Logger, ) (*ContractBindings, error) { var ( @@ -117,7 +117,7 @@ func isZeroAddress(address gethcommon.Address) bool { func NewEigenlayerContractBindings( delegationManagerAddr gethcommon.Address, avsDirectoryAddr gethcommon.Address, - ethclient eth.Client, + ethclient eth.HttpBackend, logger logging.Logger, ) (*ContractBindings, error) { contractDelegationManager, err := delegationmanager.NewContractDelegationManager(delegationManagerAddr, ethclient) diff --git a/chainio/clients/elcontracts/builder.go b/chainio/clients/elcontracts/builder.go index ba966d6c..2c568517 100644 --- a/chainio/clients/elcontracts/builder.go +++ b/chainio/clients/elcontracts/builder.go @@ -9,7 +9,7 @@ import ( func BuildClients( config Config, - client eth.Client, + client eth.HttpBackend, txMgr txmgr.TxManager, logger logging.Logger, eigenMetrics *metrics.EigenMetrics, diff --git a/chainio/clients/elcontracts/reader.go b/chainio/clients/elcontracts/reader.go index 05db2c30..97aafa54 100644 --- a/chainio/clients/elcontracts/reader.go +++ b/chainio/clients/elcontracts/reader.go @@ -22,50 +22,6 @@ import ( "github.com/Layr-Labs/eigensdk-go/utils" ) -type Reader interface { - IsOperatorRegistered(opts *bind.CallOpts, operator types.Operator) (bool, error) - - GetOperatorDetails(opts *bind.CallOpts, operator types.Operator) (types.Operator, error) - - // GetStrategyAndUnderlyingToken returns the strategy contract and the underlying token address - // use GetStrategyAndUnderlyingERC20Token if the contract address confirms with ERC20 standard - GetStrategyAndUnderlyingToken( - opts *bind.CallOpts, strategyAddr gethcommon.Address, - ) (*strategy.ContractIStrategy, gethcommon.Address, error) - - // GetStrategyAndUnderlyingERC20Token returns the strategy contract and the underlying ERC20 token address - GetStrategyAndUnderlyingERC20Token( - opts *bind.CallOpts, strategyAddr gethcommon.Address, - ) (*strategy.ContractIStrategy, erc20.ContractIERC20Methods, gethcommon.Address, error) - - ServiceManagerCanSlashOperatorUntilBlock( - opts *bind.CallOpts, - operatorAddr gethcommon.Address, - serviceManagerAddr gethcommon.Address, - ) (uint32, error) - - OperatorIsFrozen(opts *bind.CallOpts, operatorAddr gethcommon.Address) (bool, error) - - GetOperatorSharesInStrategy( - opts *bind.CallOpts, - operatorAddr gethcommon.Address, - strategyAddr gethcommon.Address, - ) (*big.Int, error) - - CalculateDelegationApprovalDigestHash( - opts *bind.CallOpts, staker gethcommon.Address, operator gethcommon.Address, - delegationApprover gethcommon.Address, approverSalt [32]byte, expiry *big.Int, - ) ([32]byte, error) - - CalculateOperatorAVSRegistrationDigestHash( - opts *bind.CallOpts, operator gethcommon.Address, avs gethcommon.Address, salt [32]byte, expiry *big.Int, - ) ([32]byte, error) - - GetDistributionRootsLength(opts *bind.CallOpts) (*big.Int, error) - - CurrRewardsCalculationEndTimestamp(opts *bind.CallOpts) (uint32, error) -} - type Config struct { DelegationManagerAddress common.Address AvsDirectoryAddress common.Address @@ -79,12 +35,9 @@ type ChainReader struct { strategyManager *strategymanager.ContractStrategyManager avsDirectory *avsdirectory.ContractAVSDirectory rewardsCoordinator *rewardscoordinator.ContractIRewardsCoordinator - ethClient eth.Client + ethClient eth.HttpBackend } -// forces EthReader to implement the chainio.Reader interface -var _ Reader = (*ChainReader)(nil) - func NewChainReader( slasher slasher.ContractISlasherCalls, delegationManager *delegationmanager.ContractDelegationManager, @@ -92,7 +45,7 @@ func NewChainReader( avsDirectory *avsdirectory.ContractAVSDirectory, rewardsCoordinator *rewardscoordinator.ContractIRewardsCoordinator, logger logging.Logger, - ethClient eth.Client, + ethClient eth.HttpBackend, ) *ChainReader { logger = logger.With(logging.ComponentKey, "elcontracts/reader") @@ -112,7 +65,7 @@ func NewChainReader( func BuildELChainReader( delegationManagerAddr gethcommon.Address, avsDirectoryAddr gethcommon.Address, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, ) (*ChainReader, error) { elContractBindings, err := NewEigenlayerContractBindings( @@ -137,7 +90,7 @@ func BuildELChainReader( func NewReaderFromConfig( cfg Config, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, ) (*ChainReader, error) { elContractBindings, err := NewBindingsFromConfig( diff --git a/chainio/clients/elcontracts/writer.go b/chainio/clients/elcontracts/writer.go index c426c258..f0578b41 100644 --- a/chainio/clients/elcontracts/writer.go +++ b/chainio/clients/elcontracts/writer.go @@ -15,42 +15,20 @@ import ( "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" delegationmanager "github.com/Layr-Labs/eigensdk-go/contracts/bindings/DelegationManager" + erc20 "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IERC20" rewardscoordinator "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IRewardsCoordinator" slasher "github.com/Layr-Labs/eigensdk-go/contracts/bindings/ISlasher" + strategy "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IStrategy" strategymanager "github.com/Layr-Labs/eigensdk-go/contracts/bindings/StrategyManager" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/metrics" "github.com/Layr-Labs/eigensdk-go/types" ) -type Writer interface { - // RegisterAsOperator registers an operator onchain. - RegisterAsOperator(ctx context.Context, operator types.Operator) (*gethtypes.Receipt, error) - - // UpdateOperatorDetails updates the operator details onchain. - // This doesn't update the metadata URI. Use UpdateMetadataURI for that. - UpdateOperatorDetails(ctx context.Context, operator types.Operator) (*gethtypes.Receipt, error) - - // UpdateMetadataURI updates the operator metadata URI onchain - UpdateMetadataURI(ctx context.Context, uri string) (*gethtypes.Receipt, error) - - // DepositERC20IntoStrategy deposits ERC20 tokens into a strategy contract. - DepositERC20IntoStrategy( - ctx context.Context, - strategyAddr gethcommon.Address, - amount *big.Int, - ) (*gethtypes.Receipt, error) - - SetClaimerFor( - ctx context.Context, - claimer gethcommon.Address, - ) (*gethtypes.Receipt, error) - - ProcessClaim( - ctx context.Context, - claim rewardscoordinator.IRewardsCoordinatorRewardsMerkleClaim, - earnerAddress gethcommon.Address, - ) (*gethtypes.Receipt, error) +type Reader interface { + GetStrategyAndUnderlyingERC20Token( + opts *bind.CallOpts, strategyAddr gethcommon.Address, + ) (*strategy.ContractIStrategy, erc20.ContractIERC20Methods, gethcommon.Address, error) } type ChainWriter struct { @@ -60,13 +38,11 @@ type ChainWriter struct { rewardsCoordinator *rewardscoordinator.ContractIRewardsCoordinator strategyManagerAddr gethcommon.Address elChainReader Reader - ethClient eth.Client + ethClient eth.HttpBackend logger logging.Logger txMgr txmgr.TxManager } -var _ Writer = (*ChainWriter)(nil) - func NewChainWriter( slasher *slasher.ContractISlasher, delegationManager *delegationmanager.ContractDelegationManager, @@ -74,7 +50,7 @@ func NewChainWriter( rewardsCoordinator *rewardscoordinator.ContractIRewardsCoordinator, strategyManagerAddr gethcommon.Address, elChainReader Reader, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, eigenMetrics metrics.Metrics, txMgr txmgr.TxManager, @@ -99,7 +75,7 @@ func NewChainWriter( func BuildELChainWriter( delegationManagerAddr gethcommon.Address, avsDirectoryAddr gethcommon.Address, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, eigenMetrics metrics.Metrics, txMgr txmgr.TxManager, @@ -138,7 +114,7 @@ func BuildELChainWriter( func NewWriterFromConfig( cfg Config, - ethClient eth.Client, + ethClient eth.HttpBackend, logger logging.Logger, eigenMetrics metrics.Metrics, txMgr txmgr.TxManager, diff --git a/chainio/clients/eth/client.go b/chainio/clients/eth/client.go index 16ee4e14..709851b7 100644 --- a/chainio/clients/eth/client.go +++ b/chainio/clients/eth/client.go @@ -4,54 +4,29 @@ import ( "context" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" ) -type Client interface { - ChainID(ctx context.Context) (*big.Int, error) - BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) - BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) - BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) +// HttpBackend is the HTTP ETH Client interface +// It is exactly the same as the WsBackend and there is no difference between them to the compiler, +// but we keep them separate as a signal to the programmer that an eth.Client with an underlying http/ws connection is +// expected +type HttpBackend interface { + bind.ContractBackend + BlockNumber(ctx context.Context) (uint64, error) - CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) - CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) - CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) - EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) - FeeHistory( - ctx context.Context, - blockCount uint64, - lastBlock *big.Int, - rewardPercentiles []float64, - ) (*ethereum.FeeHistory, error) - FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) - HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) - HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) - NetworkID(ctx context.Context) (*big.Int, error) - NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) - PeerCount(ctx context.Context) (uint64, error) - PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) - PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) - PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) - PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) - PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) - PendingTransactionCount(ctx context.Context) (uint, error) - SendTransaction(ctx context.Context, tx *types.Transaction) error - StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) - SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) - SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) - SuggestGasPrice(ctx context.Context) (*big.Int, error) - SuggestGasTipCap(ctx context.Context) (*big.Int, error) - SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) - TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error) - TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) - TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) - TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) - TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error) + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) } -func NewClient(rpcAddress string) (Client, error) { - return ethclient.Dial(rpcAddress) +// WsBackend is the Websocket ETH Client interface +// It is exactly the same as the HttpBackend and there is no difference between them to the compiler, +// but we keep them separate as a signal to the programmer that an eth.Client with an underlying http/ws connection is +// expected +type WsBackend interface { + bind.ContractBackend + + BlockNumber(ctx context.Context) (uint64, error) + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) } diff --git a/chainio/clients/eth/instrumented_client.go b/chainio/clients/eth/instrumented_client.go index cf2d3877..1e90a8c1 100644 --- a/chainio/clients/eth/instrumented_client.go +++ b/chainio/clients/eth/instrumented_client.go @@ -27,7 +27,8 @@ type InstrumentedClient struct { clientAndVersion string } -var _ Client = (*InstrumentedClient)(nil) +var _ HttpBackend = (*InstrumentedClient)(nil) +var _ WsBackend = (*InstrumentedClient)(nil) func NewInstrumentedClient(rpcAddress string, rpcCallsCollector *rpccalls.Collector) (*InstrumentedClient, error) { client, err := ethclient.Dial(rpcAddress) @@ -115,19 +116,6 @@ func (iec *InstrumentedClient) CallContract( return bytes, nil } -func (iec *InstrumentedClient) CallContractAtHash( - ctx context.Context, - msg ethereum.CallMsg, - blockHash common.Hash, -) ([]byte, error) { - callContractAtHash := func() ([]byte, error) { return iec.client.CallContractAtHash(ctx, msg, blockHash) } - bytes, err := instrumentFunction[[]byte](callContractAtHash, "eth_call", iec) - if err != nil { - return nil, err - } - return bytes, nil -} - func (iec *InstrumentedClient) CodeAt( ctx context.Context, contract common.Address, @@ -205,15 +193,6 @@ func (iec *InstrumentedClient) HeaderByNumber(ctx context.Context, number *big.I return header, nil } -func (iec *InstrumentedClient) NetworkID(ctx context.Context) (*big.Int, error) { - networkID := func() (*big.Int, error) { return iec.client.NetworkID(ctx) } - id, err := instrumentFunction[*big.Int](networkID, "net_version", iec) - if err != nil { - return nil, err - } - return id, nil -} - func (iec *InstrumentedClient) NonceAt( ctx context.Context, account common.Address, @@ -227,15 +206,6 @@ func (iec *InstrumentedClient) NonceAt( return nonce, nil } -func (iec *InstrumentedClient) PeerCount(ctx context.Context) (uint64, error) { - peerCount := func() (uint64, error) { return iec.client.PeerCount(ctx) } - count, err := instrumentFunction[uint64](peerCount, "net_peerCount", iec) - if err != nil { - return 0, err - } - return count, nil -} - func (iec *InstrumentedClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) { pendingBalanceAt := func() (*big.Int, error) { return iec.client.PendingBalanceAt(ctx, account) } balance, err := instrumentFunction[*big.Int](pendingBalanceAt, "eth_getBalance", iec) @@ -460,42 +430,6 @@ func (iec *InstrumentedClient) TransactionReceipt(ctx context.Context, txHash co return receipt, nil } -func (iec *InstrumentedClient) TransactionSender( - ctx context.Context, - tx *types.Transaction, - block common.Hash, - index uint, -) (common.Address, error) { - transactionSender := func() (common.Address, error) { return iec.client.TransactionSender(ctx, tx, block, index) } - address, err := instrumentFunction[common.Address]( - transactionSender, - "eth_getSender", - iec, - ) - if err != nil { - return common.Address{}, err - } - return address, nil -} - -// Extra methods - -// TODO(samlaf): feels weird that we have to write this function ourselves -// -// perhaps the gethClient interface should be the instrumented client, -// and then ethclient can take an instrumentedGethClient? -func (iec *InstrumentedClient) WaitForTransactionReceipt(ctx context.Context, txHash common.Hash) *types.Receipt { - for { - // verifying transaction receipt - receipt, err := iec.TransactionReceipt(ctx, txHash) - if err != nil { - time.Sleep(2 * time.Second) - } else { - return receipt - } - } -} - // Not sure why this method is not exposed in the ethclient itself... // but it is needed to comply with the rpc metrics defined in avs-node spec // https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/metrics/metrics-prom-spec diff --git a/chainio/clients/fireblocks/get_asset_addresses.go b/chainio/clients/fireblocks/get_asset_addresses.go index 26c961cc..e1a05281 100644 --- a/chainio/clients/fireblocks/get_asset_addresses.go +++ b/chainio/clients/fireblocks/get_asset_addresses.go @@ -4,31 +4,64 @@ import ( "context" "encoding/json" "fmt" + "net/url" "strings" ) type AssetAddress struct { AssetID AssetID `json:"assetId"` Address string `json:"address"` - Tag string `json:"tag"` Description string `json:"description"` + Tag string `json:"tag"` Type string `json:"type"` + CustomerRefID string `json:"customerRefId"` + AddressFormat string `json:"addressFormat"` LegacyAddress string `json:"legacyAddress"` EnterpriseAddress string `json:"enterpriseAddress"` + BIP44AddressIndex int `json:"bip44AddressIndex"` UserDefined bool `json:"userDefined"` } func (f *client) GetAssetAddresses(ctx context.Context, vaultID string, assetID AssetID) ([]AssetAddress, error) { f.logger.Debug("Fireblocks get asset addressees", "vaultID", vaultID, "assetID", assetID) - path := fmt.Sprintf("/v1/vault/accounts/%s/%s/addresses", vaultID, assetID) - res, err := f.makeRequest(ctx, "GET", path, nil) - if err != nil { - return nil, fmt.Errorf("error making request: %w", err) - } var addresses []AssetAddress - err = json.NewDecoder(strings.NewReader(string(res))).Decode(&addresses) - if err != nil { - return nil, fmt.Errorf("error parsing response body: %w", err) + type paging struct { + Before string `json:"before"` + After string `json:"after"` + } + var response struct { + Addresses []AssetAddress `json:"addresses"` + Paging paging `json:"paging"` + } + + p := paging{} + next := true + for next { + path := fmt.Sprintf("/v1/vault/accounts/%s/%s/addresses_paginated", vaultID, assetID) + u, err := url.Parse(path) + if err != nil { + return addresses, fmt.Errorf("error parsing URL: %w", err) + } + q := u.Query() + q.Set("before", p.Before) + q.Set("after", p.After) + u.RawQuery = q.Encode() + + res, err := f.makeRequest(ctx, "GET", u.String(), nil) + if err != nil { + return nil, fmt.Errorf("error making request: %w", err) + } + body := string(res) + err = json.NewDecoder(strings.NewReader(body)).Decode(&response) + if err != nil { + return addresses, fmt.Errorf("error parsing response body: %s: %w", body, err) + } + + addresses = append(addresses, response.Addresses...) + p = response.Paging + if p.After == "" { + next = false + } } return addresses, nil diff --git a/chainio/clients/fireblocks/list_vault_accounts.go b/chainio/clients/fireblocks/list_vault_accounts.go index ee575380..068d5ab1 100644 --- a/chainio/clients/fireblocks/list_vault_accounts.go +++ b/chainio/clients/fireblocks/list_vault_accounts.go @@ -42,7 +42,6 @@ func (f *client) ListVaultAccounts(ctx context.Context) ([]VaultAccount, error) q.Set("before", p.Before) q.Set("after", p.After) u.RawQuery = q.Encode() - fmt.Println("URL: ", u.String()) res, err := f.makeRequest(ctx, "GET", u.String(), nil) if err != nil { return accounts, fmt.Errorf("error making request: %w", err) diff --git a/chainio/clients/wallet/fireblocks_wallet.go b/chainio/clients/wallet/fireblocks_wallet.go index e550a35e..4f077c3f 100644 --- a/chainio/clients/wallet/fireblocks_wallet.go +++ b/chainio/clients/wallet/fireblocks_wallet.go @@ -8,9 +8,11 @@ import ( "strconv" "sync" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/fireblocks" "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -31,13 +33,20 @@ var ( ErrTransactionFailed = errors.New("transaction failed") ) +type ethClient interface { + ChainID(ctx context.Context) (*big.Int, error) + TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + + bind.ContractBackend +} + type fireblocksWallet struct { // mu protects access to nonceToTxID and txIDToNonce which can be // accessed concurrently by SendTransaction and GetTransactionReceipt mu sync.Mutex fireblocksClient fireblocks.Client - ethClient eth.Client + ethClient ethClient vaultAccountName string logger logging.Logger chainID *big.Int @@ -56,7 +65,7 @@ type fireblocksWallet struct { func NewFireblocksWallet( fireblocksClient fireblocks.Client, - ethClient eth.Client, + ethClient ethClient, vaultAccountName string, logger logging.Logger, ) (Wallet, error) { diff --git a/chainio/clients/wallet/fireblocks_wallet_test.go b/chainio/clients/wallet/fireblocks_wallet_test.go index f07ecba5..234ad121 100644 --- a/chainio/clients/wallet/fireblocks_wallet_test.go +++ b/chainio/clients/wallet/fireblocks_wallet_test.go @@ -5,12 +5,12 @@ import ( "math/big" "testing" + "github.com/Layr-Labs/eigensdk-go/internal/fakes" + "github.com/Layr-Labs/eigensdk-go/chainio/clients/fireblocks" cmocks "github.com/Layr-Labs/eigensdk-go/chainio/clients/mocks" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" - "github.com/Layr-Labs/eigensdk-go/chainio/mocks" "github.com/Layr-Labs/eigensdk-go/logging" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/assert" @@ -27,10 +27,9 @@ func TestSendTransaction(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -87,10 +86,9 @@ func TestTransfer(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -175,10 +173,9 @@ func TestSendTransactionNoValidContract(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -231,10 +228,9 @@ func TestSendTransactionNoValidExternalAccount(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -291,10 +287,9 @@ func TestSendTransactionInvalidVault(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -329,10 +324,9 @@ func TestSendTransactionReplaceTx(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) @@ -429,27 +423,21 @@ func TestWaitForTransactionReceipt(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) - expectedTxHash := "0x0000000000000000000000000000000000000000000000000000000000001234" - fireblocksClient.EXPECT().GetTransaction(gomock.Any(), expectedTxHash).Return(&fireblocks.Transaction{ - ID: expectedTxHash, + fireblocksClient.EXPECT().GetTransaction(gomock.Any(), fakes.TransactionHash).Return(&fireblocks.Transaction{ + ID: fakes.TransactionHash, Status: fireblocks.Completed, - TxHash: expectedTxHash, - }, nil) - ethClient.EXPECT().TransactionReceipt(gomock.Any(), common.HexToHash(expectedTxHash)).Return(&types.Receipt{ - TxHash: common.HexToHash(expectedTxHash), - BlockNumber: big.NewInt(1234), + TxHash: fakes.TransactionHash, }, nil) - receipt, err := sender.GetTransactionReceipt(context.Background(), expectedTxHash) + receipt, err := sender.GetTransactionReceipt(context.Background(), fakes.TransactionHash) assert.NoError(t, err) - assert.Equal(t, expectedTxHash, receipt.TxHash.String()) + assert.Equal(t, fakes.TransactionHash, receipt.TxHash.String()) assert.Equal(t, big.NewInt(1234), receipt.BlockNumber) } @@ -457,21 +445,19 @@ func TestWaitForTransactionReceiptFailFromFireblocks(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) - expectedTxHash := "0x0000000000000000000000000000000000000000000000000000000000001234" - fireblocksClient.EXPECT().GetTransaction(gomock.Any(), expectedTxHash).Return(&fireblocks.Transaction{ - ID: expectedTxHash, + fireblocksClient.EXPECT().GetTransaction(gomock.Any(), fakes.TransactionHash).Return(&fireblocks.Transaction{ + ID: fakes.TransactionHash, Status: fireblocks.Confirming, // not completed - TxHash: expectedTxHash, + TxHash: fakes.TransactionHash, }, nil) - receipt, err := sender.GetTransactionReceipt(context.Background(), expectedTxHash) + receipt, err := sender.GetTransactionReceipt(context.Background(), fakes.TransactionHash) assert.ErrorAs(t, err, &wallet.ErrReceiptNotYetAvailable) assert.Nil(t, receipt) } @@ -480,21 +466,19 @@ func TestWaitForTransactionReceiptStuckAtFireblocks(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) - expectedTxHash := "0x0000000000000000000000000000000000000000000000000000000000001234" - fireblocksClient.EXPECT().GetTransaction(gomock.Any(), expectedTxHash).Return(&fireblocks.Transaction{ - ID: expectedTxHash, + fireblocksClient.EXPECT().GetTransaction(gomock.Any(), fakes.TransactionHash).Return(&fireblocks.Transaction{ + ID: fakes.TransactionHash, Status: fireblocks.PendingSignature, // not completed - TxHash: expectedTxHash, + TxHash: fakes.TransactionHash, }, nil) - receipt, err := sender.GetTransactionReceipt(context.Background(), expectedTxHash) + receipt, err := sender.GetTransactionReceipt(context.Background(), fakes.TransactionHash) assert.ErrorAs(t, err, &wallet.ErrNotYetBroadcasted) assert.Nil(t, receipt) } @@ -503,22 +487,21 @@ func TestWaitForTransactionReceiptFailFromChain(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) sender, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) - expectedTxHash := "0x0000000000000000000000000000000000000000000000000000000000001234" - fireblocksClient.EXPECT().GetTransaction(gomock.Any(), expectedTxHash).Return(&fireblocks.Transaction{ - ID: expectedTxHash, - Status: fireblocks.Completed, - TxHash: expectedTxHash, - }, nil) - ethClient.EXPECT().TransactionReceipt(gomock.Any(), common.HexToHash(expectedTxHash)).Return(nil, ethereum.NotFound) + fireblocksClient.EXPECT(). + GetTransaction(gomock.Any(), fakes.TransactionNashNotInFake). + Return(&fireblocks.Transaction{ + ID: fakes.TransactionNashNotInFake, + Status: fireblocks.Completed, + TxHash: fakes.TransactionNashNotInFake, + }, nil) - receipt, err := sender.GetTransactionReceipt(context.Background(), expectedTxHash) + receipt, err := sender.GetTransactionReceipt(context.Background(), fakes.TransactionNashNotInFake) assert.Error(t, err) assert.Nil(t, receipt) } @@ -527,10 +510,9 @@ func TestSenderAddress(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() fireblocksClient := cmocks.NewMockFireblocksClient(ctrl) - ethClient := mocks.NewMockEthClient(ctrl) + ethClient := fakes.NewEthClient() logger, err := logging.NewZapLogger(logging.Development) assert.NoError(t, err) - ethClient.EXPECT().ChainID(gomock.Any()).Return(big.NewInt(5), nil) w, err := wallet.NewFireblocksWallet(fireblocksClient, ethClient, vaultAccountName, logger) assert.NoError(t, err) assetID := fireblocks.AssetIDByChain[5] diff --git a/chainio/clients/wallet/privatekey_wallet.go b/chainio/clients/wallet/privatekey_wallet.go index 33ae3728..acec1ee8 100644 --- a/chainio/clients/wallet/privatekey_wallet.go +++ b/chainio/clients/wallet/privatekey_wallet.go @@ -5,7 +5,6 @@ import ( "fmt" "math/big" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/signerv2" "github.com/Layr-Labs/eigensdk-go/utils" @@ -18,7 +17,7 @@ import ( var _ Wallet = (*privateKeyWallet)(nil) type privateKeyWallet struct { - ethClient eth.Client + ethClient ethClient address common.Address signerFn signerv2.SignerFn logger logging.Logger @@ -28,7 +27,7 @@ type privateKeyWallet struct { } func NewPrivateKeyWallet( - ethClient eth.Client, + ethClient ethClient, signer signerv2.SignerFn, signerAddress common.Address, logger logging.Logger, diff --git a/chainio/gen.go b/chainio/gen.go index e80ef40b..8535bf47 100644 --- a/chainio/gen.go +++ b/chainio/gen.go @@ -1,11 +1,4 @@ package chainio -//go:generate mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks -mock_names=Reader=MockAVSReader github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader -//go:generate mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks -mock_names=Subscriber=MockAVSSubscriber github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber -//go:generate mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks -mock_names=Writer=MockAVSWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer -//go:generate mockgen -destination=./mocks/elContractsReader.go -package=mocks -mock_names=Reader=MockELReader github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts Reader -//go:generate mockgen -destination=./mocks/elContractsWriter.go -package=mocks -mock_names=Writer=MockELWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts Writer -//go:generate mockgen -destination=./mocks/ethclient.go -package=mocks -mock_names=Client=MockEthClient github.com/Layr-Labs/eigensdk-go/chainio/clients/eth Client -//go:generate mockgen -destination=./mocks/eventSubscription.go -package=mocks github.com/ethereum/go-ethereum/event Subscription //go:generate mockgen -destination=./clients/mocks/fireblocks.go -package=mocks -mock_names=Client=MockFireblocksClient github.com/Layr-Labs/eigensdk-go/chainio/clients/fireblocks Client //go:generate mockgen -destination=./clients/mocks/wallet.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet Wallet diff --git a/chainio/mocks/avsRegistryContractsReader.go b/chainio/mocks/avsRegistryContractsReader.go deleted file mode 100644 index 15305b91..00000000 --- a/chainio/mocks/avsRegistryContractsReader.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry (interfaces: Reader) -// -// Generated by this command: -// -// mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks -mock_names=Reader=MockAVSReader github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - big "math/big" - reflect "reflect" - - contractOperatorStateRetriever "github.com/Layr-Labs/eigensdk-go/contracts/bindings/OperatorStateRetriever" - types "github.com/Layr-Labs/eigensdk-go/types" - bind "github.com/ethereum/go-ethereum/accounts/abi/bind" - common "github.com/ethereum/go-ethereum/common" - gomock "go.uber.org/mock/gomock" -) - -// MockAVSReader is a mock of Reader interface. -type MockAVSReader struct { - ctrl *gomock.Controller - recorder *MockAVSReaderMockRecorder -} - -// MockAVSReaderMockRecorder is the mock recorder for MockAVSReader. -type MockAVSReaderMockRecorder struct { - mock *MockAVSReader -} - -// NewMockAVSReader creates a new mock instance. -func NewMockAVSReader(ctrl *gomock.Controller) *MockAVSReader { - mock := &MockAVSReader{ctrl: ctrl} - mock.recorder = &MockAVSReaderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAVSReader) EXPECT() *MockAVSReaderMockRecorder { - return m.recorder -} - -// GetCheckSignaturesIndices mocks base method. -func (m *MockAVSReader) GetCheckSignaturesIndices(arg0 *bind.CallOpts, arg1 uint32, arg2 types.QuorumNums, arg3 []types.Bytes32) (contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCheckSignaturesIndices", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetCheckSignaturesIndices indicates an expected call of GetCheckSignaturesIndices. -func (mr *MockAVSReaderMockRecorder) GetCheckSignaturesIndices(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckSignaturesIndices", reflect.TypeOf((*MockAVSReader)(nil).GetCheckSignaturesIndices), arg0, arg1, arg2, arg3) -} - -// GetOperatorAddrsInQuorumsAtCurrentBlock mocks base method. -func (m *MockAVSReader) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]common.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorAddrsInQuorumsAtCurrentBlock", arg0, arg1) - ret0, _ := ret[0].([][]common.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorAddrsInQuorumsAtCurrentBlock indicates an expected call of GetOperatorAddrsInQuorumsAtCurrentBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorAddrsInQuorumsAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorAddrsInQuorumsAtCurrentBlock), arg0, arg1) -} - -// GetOperatorFromId mocks base method. -func (m *MockAVSReader) GetOperatorFromId(arg0 *bind.CallOpts, arg1 types.Bytes32) (common.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorFromId", arg0, arg1) - ret0, _ := ret[0].(common.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorFromId indicates an expected call of GetOperatorFromId. -func (mr *MockAVSReaderMockRecorder) GetOperatorFromId(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorFromId", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorFromId), arg0, arg1) -} - -// GetOperatorId mocks base method. -func (m *MockAVSReader) GetOperatorId(arg0 *bind.CallOpts, arg1 common.Address) ([32]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorId", arg0, arg1) - ret0, _ := ret[0].([32]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorId indicates an expected call of GetOperatorId. -func (mr *MockAVSReaderMockRecorder) GetOperatorId(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorId", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorId), arg0, arg1) -} - -// GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock mocks base method. -func (m *MockAVSReader) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (map[types.QuorumNum]*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock", arg0, arg1) - ret0, _ := ret[0].(map[types.QuorumNum]*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock indicates an expected call of GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) -} - -// GetOperatorsStakeInQuorumsAtBlock mocks base method. -func (m *MockAVSReader) GetOperatorsStakeInQuorumsAtBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums, arg2 uint32) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsAtBlock", arg0, arg1, arg2) - ret0, _ := ret[0].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorsStakeInQuorumsAtBlock indicates an expected call of GetOperatorsStakeInQuorumsAtBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsAtBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsAtBlock), arg0, arg1, arg2) -} - -// GetOperatorsStakeInQuorumsAtCurrentBlock mocks base method. -func (m *MockAVSReader) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsAtCurrentBlock", arg0, arg1) - ret0, _ := ret[0].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorsStakeInQuorumsAtCurrentBlock indicates an expected call of GetOperatorsStakeInQuorumsAtCurrentBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsAtCurrentBlock), arg0, arg1) -} - -// GetOperatorsStakeInQuorumsOfOperatorAtBlock mocks base method. -func (m *MockAVSReader) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0 *bind.CallOpts, arg1 types.Bytes32, arg2 uint32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsOfOperatorAtBlock", arg0, arg1, arg2) - ret0, _ := ret[0].(types.QuorumNums) - ret1, _ := ret[1].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// GetOperatorsStakeInQuorumsOfOperatorAtBlock indicates an expected call of GetOperatorsStakeInQuorumsOfOperatorAtBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtBlock), arg0, arg1, arg2) -} - -// GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock mocks base method. -func (m *MockAVSReader) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock", arg0, arg1) - ret0, _ := ret[0].(types.QuorumNums) - ret1, _ := ret[1].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock indicates an expected call of GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock. -func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) -} - -// GetQuorumCount mocks base method. -func (m *MockAVSReader) GetQuorumCount(arg0 *bind.CallOpts) (byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQuorumCount", arg0) - ret0, _ := ret[0].(byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetQuorumCount indicates an expected call of GetQuorumCount. -func (mr *MockAVSReaderMockRecorder) GetQuorumCount(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuorumCount", reflect.TypeOf((*MockAVSReader)(nil).GetQuorumCount), arg0) -} - -// IsOperatorRegistered mocks base method. -func (m *MockAVSReader) IsOperatorRegistered(arg0 *bind.CallOpts, arg1 common.Address) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsOperatorRegistered", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// IsOperatorRegistered indicates an expected call of IsOperatorRegistered. -func (mr *MockAVSReaderMockRecorder) IsOperatorRegistered(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOperatorRegistered", reflect.TypeOf((*MockAVSReader)(nil).IsOperatorRegistered), arg0, arg1) -} - -// QueryExistingRegisteredOperatorPubKeys mocks base method. -func (m *MockAVSReader) QueryExistingRegisteredOperatorPubKeys(arg0 context.Context, arg1, arg2, arg3 *big.Int) ([]common.Address, []types.OperatorPubkeys, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "QueryExistingRegisteredOperatorPubKeys", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].([]common.Address) - ret1, _ := ret[1].([]types.OperatorPubkeys) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// QueryExistingRegisteredOperatorPubKeys indicates an expected call of QueryExistingRegisteredOperatorPubKeys. -func (mr *MockAVSReaderMockRecorder) QueryExistingRegisteredOperatorPubKeys(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorPubKeys", reflect.TypeOf((*MockAVSReader)(nil).QueryExistingRegisteredOperatorPubKeys), arg0, arg1, arg2, arg3) -} - -// QueryExistingRegisteredOperatorSockets mocks base method. -func (m *MockAVSReader) QueryExistingRegisteredOperatorSockets(arg0 context.Context, arg1, arg2, arg3 *big.Int) (map[types.Bytes32]types.Socket, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "QueryExistingRegisteredOperatorSockets", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(map[types.Bytes32]types.Socket) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// QueryExistingRegisteredOperatorSockets indicates an expected call of QueryExistingRegisteredOperatorSockets. -func (mr *MockAVSReaderMockRecorder) QueryExistingRegisteredOperatorSockets(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorSockets", reflect.TypeOf((*MockAVSReader)(nil).QueryExistingRegisteredOperatorSockets), arg0, arg1, arg2, arg3) -} diff --git a/chainio/mocks/avsRegistryContractsSubscriber.go b/chainio/mocks/avsRegistryContractsSubscriber.go deleted file mode 100644 index febfe4ef..00000000 --- a/chainio/mocks/avsRegistryContractsSubscriber.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry (interfaces: Subscriber) -// -// Generated by this command: -// -// mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks -mock_names=Subscriber=MockAVSSubscriber github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - reflect "reflect" - - contractBLSApkRegistry "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" - contractRegistryCoordinator "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" - event "github.com/ethereum/go-ethereum/event" - gomock "go.uber.org/mock/gomock" -) - -// MockAVSSubscriber is a mock of Subscriber interface. -type MockAVSSubscriber struct { - ctrl *gomock.Controller - recorder *MockAVSSubscriberMockRecorder -} - -// MockAVSSubscriberMockRecorder is the mock recorder for MockAVSSubscriber. -type MockAVSSubscriberMockRecorder struct { - mock *MockAVSSubscriber -} - -// NewMockAVSSubscriber creates a new mock instance. -func NewMockAVSSubscriber(ctrl *gomock.Controller) *MockAVSSubscriber { - mock := &MockAVSSubscriber{ctrl: ctrl} - mock.recorder = &MockAVSSubscriberMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAVSSubscriber) EXPECT() *MockAVSSubscriberMockRecorder { - return m.recorder -} - -// SubscribeToNewPubkeyRegistrations mocks base method. -func (m *MockAVSSubscriber) SubscribeToNewPubkeyRegistrations() (chan *contractBLSApkRegistry.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeToNewPubkeyRegistrations") - ret0, _ := ret[0].(chan *contractBLSApkRegistry.ContractBLSApkRegistryNewPubkeyRegistration) - ret1, _ := ret[1].(event.Subscription) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// SubscribeToNewPubkeyRegistrations indicates an expected call of SubscribeToNewPubkeyRegistrations. -func (mr *MockAVSSubscriberMockRecorder) SubscribeToNewPubkeyRegistrations() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToNewPubkeyRegistrations", reflect.TypeOf((*MockAVSSubscriber)(nil).SubscribeToNewPubkeyRegistrations)) -} - -// SubscribeToOperatorSocketUpdates mocks base method. -func (m *MockAVSSubscriber) SubscribeToOperatorSocketUpdates() (chan *contractRegistryCoordinator.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeToOperatorSocketUpdates") - ret0, _ := ret[0].(chan *contractRegistryCoordinator.ContractRegistryCoordinatorOperatorSocketUpdate) - ret1, _ := ret[1].(event.Subscription) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// SubscribeToOperatorSocketUpdates indicates an expected call of SubscribeToOperatorSocketUpdates. -func (mr *MockAVSSubscriberMockRecorder) SubscribeToOperatorSocketUpdates() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToOperatorSocketUpdates", reflect.TypeOf((*MockAVSSubscriber)(nil).SubscribeToOperatorSocketUpdates)) -} diff --git a/chainio/mocks/avsRegistryContractsWriter.go b/chainio/mocks/avsRegistryContractsWriter.go deleted file mode 100644 index 7797d777..00000000 --- a/chainio/mocks/avsRegistryContractsWriter.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry (interfaces: Writer) -// -// Generated by this command: -// -// mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks -mock_names=Writer=MockAVSWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - ecdsa "crypto/ecdsa" - big "math/big" - reflect "reflect" - - contractRegistryCoordinator "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" - bls "github.com/Layr-Labs/eigensdk-go/crypto/bls" - types "github.com/Layr-Labs/eigensdk-go/types" - common "github.com/ethereum/go-ethereum/common" - types0 "github.com/ethereum/go-ethereum/core/types" - gomock "go.uber.org/mock/gomock" -) - -// MockAVSWriter is a mock of Writer interface. -type MockAVSWriter struct { - ctrl *gomock.Controller - recorder *MockAVSWriterMockRecorder -} - -// MockAVSWriterMockRecorder is the mock recorder for MockAVSWriter. -type MockAVSWriterMockRecorder struct { - mock *MockAVSWriter -} - -// NewMockAVSWriter creates a new mock instance. -func NewMockAVSWriter(ctrl *gomock.Controller) *MockAVSWriter { - mock := &MockAVSWriter{ctrl: ctrl} - mock.recorder = &MockAVSWriterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAVSWriter) EXPECT() *MockAVSWriterMockRecorder { - return m.recorder -} - -// DeregisterOperator mocks base method. -func (m *MockAVSWriter) DeregisterOperator(arg0 context.Context, arg1 types.QuorumNums, arg2 contractRegistryCoordinator.BN254G1Point) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeregisterOperator", arg0, arg1, arg2) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DeregisterOperator indicates an expected call of DeregisterOperator. -func (mr *MockAVSWriterMockRecorder) DeregisterOperator(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterOperator", reflect.TypeOf((*MockAVSWriter)(nil).DeregisterOperator), arg0, arg1, arg2) -} - -// RegisterOperator mocks base method. -func (m *MockAVSWriter) RegisterOperator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 *bls.KeyPair, arg3 types.QuorumNums, arg4 string) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterOperator", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// RegisterOperator indicates an expected call of RegisterOperator. -func (mr *MockAVSWriterMockRecorder) RegisterOperator(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperator", reflect.TypeOf((*MockAVSWriter)(nil).RegisterOperator), arg0, arg1, arg2, arg3, arg4) -} - -// RegisterOperatorInQuorumWithAVSRegistryCoordinator mocks base method. -func (m *MockAVSWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 [32]byte, arg3 *big.Int, arg4 *bls.KeyPair, arg5 types.QuorumNums, arg6 string) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterOperatorInQuorumWithAVSRegistryCoordinator", arg0, arg1, arg2, arg3, arg4, arg5, arg6) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// RegisterOperatorInQuorumWithAVSRegistryCoordinator indicates an expected call of RegisterOperatorInQuorumWithAVSRegistryCoordinator. -func (mr *MockAVSWriterMockRecorder) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperatorInQuorumWithAVSRegistryCoordinator", reflect.TypeOf((*MockAVSWriter)(nil).RegisterOperatorInQuorumWithAVSRegistryCoordinator), arg0, arg1, arg2, arg3, arg4, arg5, arg6) -} - -// UpdateStakesOfEntireOperatorSetForQuorums mocks base method. -func (m *MockAVSWriter) UpdateStakesOfEntireOperatorSetForQuorums(arg0 context.Context, arg1 [][]common.Address, arg2 types.QuorumNums) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateStakesOfEntireOperatorSetForQuorums", arg0, arg1, arg2) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// UpdateStakesOfEntireOperatorSetForQuorums indicates an expected call of UpdateStakesOfEntireOperatorSetForQuorums. -func (mr *MockAVSWriterMockRecorder) UpdateStakesOfEntireOperatorSetForQuorums(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfEntireOperatorSetForQuorums", reflect.TypeOf((*MockAVSWriter)(nil).UpdateStakesOfEntireOperatorSetForQuorums), arg0, arg1, arg2) -} - -// UpdateStakesOfOperatorSubsetForAllQuorums mocks base method. -func (m *MockAVSWriter) UpdateStakesOfOperatorSubsetForAllQuorums(arg0 context.Context, arg1 []common.Address) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateStakesOfOperatorSubsetForAllQuorums", arg0, arg1) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// UpdateStakesOfOperatorSubsetForAllQuorums indicates an expected call of UpdateStakesOfOperatorSubsetForAllQuorums. -func (mr *MockAVSWriterMockRecorder) UpdateStakesOfOperatorSubsetForAllQuorums(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfOperatorSubsetForAllQuorums", reflect.TypeOf((*MockAVSWriter)(nil).UpdateStakesOfOperatorSubsetForAllQuorums), arg0, arg1) -} diff --git a/chainio/mocks/elContractsReader.go b/chainio/mocks/elContractsReader.go deleted file mode 100644 index 80752896..00000000 --- a/chainio/mocks/elContractsReader.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts (interfaces: Reader) -// -// Generated by this command: -// -// mockgen -destination=./mocks/elContractsReader.go -package=mocks -mock_names=Reader=MockELReader github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts Reader -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - big "math/big" - reflect "reflect" - - contractIERC20 "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IERC20" - contractIStrategy "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IStrategy" - types "github.com/Layr-Labs/eigensdk-go/types" - bind "github.com/ethereum/go-ethereum/accounts/abi/bind" - common "github.com/ethereum/go-ethereum/common" - gomock "go.uber.org/mock/gomock" -) - -// MockELReader is a mock of Reader interface. -type MockELReader struct { - ctrl *gomock.Controller - recorder *MockELReaderMockRecorder -} - -// MockELReaderMockRecorder is the mock recorder for MockELReader. -type MockELReaderMockRecorder struct { - mock *MockELReader -} - -// NewMockELReader creates a new mock instance. -func NewMockELReader(ctrl *gomock.Controller) *MockELReader { - mock := &MockELReader{ctrl: ctrl} - mock.recorder = &MockELReaderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockELReader) EXPECT() *MockELReaderMockRecorder { - return m.recorder -} - -// CalculateDelegationApprovalDigestHash mocks base method. -func (m *MockELReader) CalculateDelegationApprovalDigestHash(arg0 *bind.CallOpts, arg1, arg2, arg3 common.Address, arg4 [32]byte, arg5 *big.Int) ([32]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CalculateDelegationApprovalDigestHash", arg0, arg1, arg2, arg3, arg4, arg5) - ret0, _ := ret[0].([32]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CalculateDelegationApprovalDigestHash indicates an expected call of CalculateDelegationApprovalDigestHash. -func (mr *MockELReaderMockRecorder) CalculateDelegationApprovalDigestHash(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateDelegationApprovalDigestHash", reflect.TypeOf((*MockELReader)(nil).CalculateDelegationApprovalDigestHash), arg0, arg1, arg2, arg3, arg4, arg5) -} - -// CalculateOperatorAVSRegistrationDigestHash mocks base method. -func (m *MockELReader) CalculateOperatorAVSRegistrationDigestHash(arg0 *bind.CallOpts, arg1, arg2 common.Address, arg3 [32]byte, arg4 *big.Int) ([32]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CalculateOperatorAVSRegistrationDigestHash", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].([32]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CalculateOperatorAVSRegistrationDigestHash indicates an expected call of CalculateOperatorAVSRegistrationDigestHash. -func (mr *MockELReaderMockRecorder) CalculateOperatorAVSRegistrationDigestHash(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalculateOperatorAVSRegistrationDigestHash", reflect.TypeOf((*MockELReader)(nil).CalculateOperatorAVSRegistrationDigestHash), arg0, arg1, arg2, arg3, arg4) -} - -// CurrRewardsCalculationEndTimestamp mocks base method. -func (m *MockELReader) CurrRewardsCalculationEndTimestamp(arg0 *bind.CallOpts) (uint32, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CurrRewardsCalculationEndTimestamp", arg0) - ret0, _ := ret[0].(uint32) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CurrRewardsCalculationEndTimestamp indicates an expected call of CurrRewardsCalculationEndTimestamp. -func (mr *MockELReaderMockRecorder) CurrRewardsCalculationEndTimestamp(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrRewardsCalculationEndTimestamp", reflect.TypeOf((*MockELReader)(nil).CurrRewardsCalculationEndTimestamp), arg0) -} - -// GetDistributionRootsLength mocks base method. -func (m *MockELReader) GetDistributionRootsLength(arg0 *bind.CallOpts) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDistributionRootsLength", arg0) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDistributionRootsLength indicates an expected call of GetDistributionRootsLength. -func (mr *MockELReaderMockRecorder) GetDistributionRootsLength(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDistributionRootsLength", reflect.TypeOf((*MockELReader)(nil).GetDistributionRootsLength), arg0) -} - -// GetOperatorDetails mocks base method. -func (m *MockELReader) GetOperatorDetails(arg0 *bind.CallOpts, arg1 types.Operator) (types.Operator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorDetails", arg0, arg1) - ret0, _ := ret[0].(types.Operator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorDetails indicates an expected call of GetOperatorDetails. -func (mr *MockELReaderMockRecorder) GetOperatorDetails(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorDetails", reflect.TypeOf((*MockELReader)(nil).GetOperatorDetails), arg0, arg1) -} - -// GetOperatorSharesInStrategy mocks base method. -func (m *MockELReader) GetOperatorSharesInStrategy(arg0 *bind.CallOpts, arg1, arg2 common.Address) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorSharesInStrategy", arg0, arg1, arg2) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorSharesInStrategy indicates an expected call of GetOperatorSharesInStrategy. -func (mr *MockELReaderMockRecorder) GetOperatorSharesInStrategy(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorSharesInStrategy", reflect.TypeOf((*MockELReader)(nil).GetOperatorSharesInStrategy), arg0, arg1, arg2) -} - -// GetStrategyAndUnderlyingERC20Token mocks base method. -func (m *MockELReader) GetStrategyAndUnderlyingERC20Token(arg0 *bind.CallOpts, arg1 common.Address) (*contractIStrategy.ContractIStrategy, contractIERC20.ContractIERC20Methods, common.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStrategyAndUnderlyingERC20Token", arg0, arg1) - ret0, _ := ret[0].(*contractIStrategy.ContractIStrategy) - ret1, _ := ret[1].(contractIERC20.ContractIERC20Methods) - ret2, _ := ret[2].(common.Address) - ret3, _ := ret[3].(error) - return ret0, ret1, ret2, ret3 -} - -// GetStrategyAndUnderlyingERC20Token indicates an expected call of GetStrategyAndUnderlyingERC20Token. -func (mr *MockELReaderMockRecorder) GetStrategyAndUnderlyingERC20Token(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStrategyAndUnderlyingERC20Token", reflect.TypeOf((*MockELReader)(nil).GetStrategyAndUnderlyingERC20Token), arg0, arg1) -} - -// GetStrategyAndUnderlyingToken mocks base method. -func (m *MockELReader) GetStrategyAndUnderlyingToken(arg0 *bind.CallOpts, arg1 common.Address) (*contractIStrategy.ContractIStrategy, common.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStrategyAndUnderlyingToken", arg0, arg1) - ret0, _ := ret[0].(*contractIStrategy.ContractIStrategy) - ret1, _ := ret[1].(common.Address) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// GetStrategyAndUnderlyingToken indicates an expected call of GetStrategyAndUnderlyingToken. -func (mr *MockELReaderMockRecorder) GetStrategyAndUnderlyingToken(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStrategyAndUnderlyingToken", reflect.TypeOf((*MockELReader)(nil).GetStrategyAndUnderlyingToken), arg0, arg1) -} - -// IsOperatorRegistered mocks base method. -func (m *MockELReader) IsOperatorRegistered(arg0 *bind.CallOpts, arg1 types.Operator) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsOperatorRegistered", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// IsOperatorRegistered indicates an expected call of IsOperatorRegistered. -func (mr *MockELReaderMockRecorder) IsOperatorRegistered(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOperatorRegistered", reflect.TypeOf((*MockELReader)(nil).IsOperatorRegistered), arg0, arg1) -} - -// OperatorIsFrozen mocks base method. -func (m *MockELReader) OperatorIsFrozen(arg0 *bind.CallOpts, arg1 common.Address) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OperatorIsFrozen", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// OperatorIsFrozen indicates an expected call of OperatorIsFrozen. -func (mr *MockELReaderMockRecorder) OperatorIsFrozen(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperatorIsFrozen", reflect.TypeOf((*MockELReader)(nil).OperatorIsFrozen), arg0, arg1) -} - -// ServiceManagerCanSlashOperatorUntilBlock mocks base method. -func (m *MockELReader) ServiceManagerCanSlashOperatorUntilBlock(arg0 *bind.CallOpts, arg1, arg2 common.Address) (uint32, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ServiceManagerCanSlashOperatorUntilBlock", arg0, arg1, arg2) - ret0, _ := ret[0].(uint32) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ServiceManagerCanSlashOperatorUntilBlock indicates an expected call of ServiceManagerCanSlashOperatorUntilBlock. -func (mr *MockELReaderMockRecorder) ServiceManagerCanSlashOperatorUntilBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceManagerCanSlashOperatorUntilBlock", reflect.TypeOf((*MockELReader)(nil).ServiceManagerCanSlashOperatorUntilBlock), arg0, arg1, arg2) -} diff --git a/chainio/mocks/elContractsWriter.go b/chainio/mocks/elContractsWriter.go deleted file mode 100644 index c4e65b3d..00000000 --- a/chainio/mocks/elContractsWriter.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts (interfaces: Writer) -// -// Generated by this command: -// -// mockgen -destination=./mocks/elContractsWriter.go -package=mocks -mock_names=Writer=MockELWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts Writer -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - big "math/big" - reflect "reflect" - - contractIRewardsCoordinator "github.com/Layr-Labs/eigensdk-go/contracts/bindings/IRewardsCoordinator" - types "github.com/Layr-Labs/eigensdk-go/types" - common "github.com/ethereum/go-ethereum/common" - types0 "github.com/ethereum/go-ethereum/core/types" - gomock "go.uber.org/mock/gomock" -) - -// MockELWriter is a mock of Writer interface. -type MockELWriter struct { - ctrl *gomock.Controller - recorder *MockELWriterMockRecorder -} - -// MockELWriterMockRecorder is the mock recorder for MockELWriter. -type MockELWriterMockRecorder struct { - mock *MockELWriter -} - -// NewMockELWriter creates a new mock instance. -func NewMockELWriter(ctrl *gomock.Controller) *MockELWriter { - mock := &MockELWriter{ctrl: ctrl} - mock.recorder = &MockELWriterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockELWriter) EXPECT() *MockELWriterMockRecorder { - return m.recorder -} - -// DepositERC20IntoStrategy mocks base method. -func (m *MockELWriter) DepositERC20IntoStrategy(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DepositERC20IntoStrategy", arg0, arg1, arg2) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DepositERC20IntoStrategy indicates an expected call of DepositERC20IntoStrategy. -func (mr *MockELWriterMockRecorder) DepositERC20IntoStrategy(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DepositERC20IntoStrategy", reflect.TypeOf((*MockELWriter)(nil).DepositERC20IntoStrategy), arg0, arg1, arg2) -} - -// ProcessClaim mocks base method. -func (m *MockELWriter) ProcessClaim(arg0 context.Context, arg1 contractIRewardsCoordinator.IRewardsCoordinatorRewardsMerkleClaim, arg2 common.Address) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ProcessClaim", arg0, arg1, arg2) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ProcessClaim indicates an expected call of ProcessClaim. -func (mr *MockELWriterMockRecorder) ProcessClaim(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessClaim", reflect.TypeOf((*MockELWriter)(nil).ProcessClaim), arg0, arg1, arg2) -} - -// RegisterAsOperator mocks base method. -func (m *MockELWriter) RegisterAsOperator(arg0 context.Context, arg1 types.Operator) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterAsOperator", arg0, arg1) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// RegisterAsOperator indicates an expected call of RegisterAsOperator. -func (mr *MockELWriterMockRecorder) RegisterAsOperator(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterAsOperator", reflect.TypeOf((*MockELWriter)(nil).RegisterAsOperator), arg0, arg1) -} - -// SetClaimerFor mocks base method. -func (m *MockELWriter) SetClaimerFor(arg0 context.Context, arg1 common.Address) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetClaimerFor", arg0, arg1) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SetClaimerFor indicates an expected call of SetClaimerFor. -func (mr *MockELWriterMockRecorder) SetClaimerFor(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetClaimerFor", reflect.TypeOf((*MockELWriter)(nil).SetClaimerFor), arg0, arg1) -} - -// UpdateMetadataURI mocks base method. -func (m *MockELWriter) UpdateMetadataURI(arg0 context.Context, arg1 string) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateMetadataURI", arg0, arg1) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// UpdateMetadataURI indicates an expected call of UpdateMetadataURI. -func (mr *MockELWriterMockRecorder) UpdateMetadataURI(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMetadataURI", reflect.TypeOf((*MockELWriter)(nil).UpdateMetadataURI), arg0, arg1) -} - -// UpdateOperatorDetails mocks base method. -func (m *MockELWriter) UpdateOperatorDetails(arg0 context.Context, arg1 types.Operator) (*types0.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateOperatorDetails", arg0, arg1) - ret0, _ := ret[0].(*types0.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// UpdateOperatorDetails indicates an expected call of UpdateOperatorDetails. -func (mr *MockELWriterMockRecorder) UpdateOperatorDetails(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateOperatorDetails", reflect.TypeOf((*MockELWriter)(nil).UpdateOperatorDetails), arg0, arg1) -} diff --git a/chainio/mocks/erc20ContractClient.go b/chainio/mocks/erc20ContractClient.go deleted file mode 100644 index c95e0632..00000000 --- a/chainio/mocks/erc20ContractClient.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients (interfaces: ERC20ContractClient) -// -// Generated by this command: -// -// mockgen -destination=./mocks/erc20ContractClient.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients ERC20ContractClient -// -// Package mocks is a generated GoMock package. -package mocks - -import ( - big "math/big" - reflect "reflect" - - bind "github.com/ethereum/go-ethereum/accounts/abi/bind" - common "github.com/ethereum/go-ethereum/common" - types "github.com/ethereum/go-ethereum/core/types" - gomock "go.uber.org/mock/gomock" -) - -// MockERC20ContractClient is a mock of ERC20ContractClient interface. -type MockERC20ContractClient struct { - ctrl *gomock.Controller - recorder *MockERC20ContractClientMockRecorder -} - -// MockERC20ContractClientMockRecorder is the mock recorder for MockERC20ContractClient. -type MockERC20ContractClientMockRecorder struct { - mock *MockERC20ContractClient -} - -// NewMockERC20ContractClient creates a new mock instance. -func NewMockERC20ContractClient(ctrl *gomock.Controller) *MockERC20ContractClient { - mock := &MockERC20ContractClient{ctrl: ctrl} - mock.recorder = &MockERC20ContractClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockERC20ContractClient) EXPECT() *MockERC20ContractClientMockRecorder { - return m.recorder -} - -// Approve mocks base method. -func (m *MockERC20ContractClient) Approve(arg0 *bind.TransactOpts, arg1 common.Address, arg2 *big.Int) (*types.Transaction, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Approve", arg0, arg1, arg2) - ret0, _ := ret[0].(*types.Transaction) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Approve indicates an expected call of Approve. -func (mr *MockERC20ContractClientMockRecorder) Approve(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Approve", reflect.TypeOf((*MockERC20ContractClient)(nil).Approve), arg0, arg1, arg2) -} diff --git a/chainio/mocks/ethclient.go b/chainio/mocks/ethclient.go deleted file mode 100644 index e54fba51..00000000 --- a/chainio/mocks/ethclient.go +++ /dev/null @@ -1,554 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/chainio/clients/eth (interfaces: Client) -// -// Generated by this command: -// -// mockgen -destination=./mocks/ethclient.go -package=mocks -mock_names=Client=MockEthClient github.com/Layr-Labs/eigensdk-go/chainio/clients/eth Client -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - big "math/big" - reflect "reflect" - - ethereum "github.com/ethereum/go-ethereum" - common "github.com/ethereum/go-ethereum/common" - types "github.com/ethereum/go-ethereum/core/types" - gomock "go.uber.org/mock/gomock" -) - -// MockEthClient is a mock of Client interface. -type MockEthClient struct { - ctrl *gomock.Controller - recorder *MockEthClientMockRecorder -} - -// MockEthClientMockRecorder is the mock recorder for MockEthClient. -type MockEthClientMockRecorder struct { - mock *MockEthClient -} - -// NewMockEthClient creates a new mock instance. -func NewMockEthClient(ctrl *gomock.Controller) *MockEthClient { - mock := &MockEthClient{ctrl: ctrl} - mock.recorder = &MockEthClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockEthClient) EXPECT() *MockEthClientMockRecorder { - return m.recorder -} - -// BalanceAt mocks base method. -func (m *MockEthClient) BalanceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BalanceAt", arg0, arg1, arg2) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BalanceAt indicates an expected call of BalanceAt. -func (mr *MockEthClientMockRecorder) BalanceAt(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BalanceAt", reflect.TypeOf((*MockEthClient)(nil).BalanceAt), arg0, arg1, arg2) -} - -// BlockByHash mocks base method. -func (m *MockEthClient) BlockByHash(arg0 context.Context, arg1 common.Hash) (*types.Block, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BlockByHash", arg0, arg1) - ret0, _ := ret[0].(*types.Block) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BlockByHash indicates an expected call of BlockByHash. -func (mr *MockEthClientMockRecorder) BlockByHash(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByHash", reflect.TypeOf((*MockEthClient)(nil).BlockByHash), arg0, arg1) -} - -// BlockByNumber mocks base method. -func (m *MockEthClient) BlockByNumber(arg0 context.Context, arg1 *big.Int) (*types.Block, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BlockByNumber", arg0, arg1) - ret0, _ := ret[0].(*types.Block) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BlockByNumber indicates an expected call of BlockByNumber. -func (mr *MockEthClientMockRecorder) BlockByNumber(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByNumber", reflect.TypeOf((*MockEthClient)(nil).BlockByNumber), arg0, arg1) -} - -// BlockNumber mocks base method. -func (m *MockEthClient) BlockNumber(arg0 context.Context) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BlockNumber", arg0) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BlockNumber indicates an expected call of BlockNumber. -func (mr *MockEthClientMockRecorder) BlockNumber(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumber", reflect.TypeOf((*MockEthClient)(nil).BlockNumber), arg0) -} - -// CallContract mocks base method. -func (m *MockEthClient) CallContract(arg0 context.Context, arg1 ethereum.CallMsg, arg2 *big.Int) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CallContract", arg0, arg1, arg2) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CallContract indicates an expected call of CallContract. -func (mr *MockEthClientMockRecorder) CallContract(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContract", reflect.TypeOf((*MockEthClient)(nil).CallContract), arg0, arg1, arg2) -} - -// CallContractAtHash mocks base method. -func (m *MockEthClient) CallContractAtHash(arg0 context.Context, arg1 ethereum.CallMsg, arg2 common.Hash) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CallContractAtHash", arg0, arg1, arg2) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CallContractAtHash indicates an expected call of CallContractAtHash. -func (mr *MockEthClientMockRecorder) CallContractAtHash(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CallContractAtHash", reflect.TypeOf((*MockEthClient)(nil).CallContractAtHash), arg0, arg1, arg2) -} - -// ChainID mocks base method. -func (m *MockEthClient) ChainID(arg0 context.Context) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ChainID", arg0) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ChainID indicates an expected call of ChainID. -func (mr *MockEthClientMockRecorder) ChainID(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainID", reflect.TypeOf((*MockEthClient)(nil).ChainID), arg0) -} - -// CodeAt mocks base method. -func (m *MockEthClient) CodeAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CodeAt", arg0, arg1, arg2) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CodeAt indicates an expected call of CodeAt. -func (mr *MockEthClientMockRecorder) CodeAt(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CodeAt", reflect.TypeOf((*MockEthClient)(nil).CodeAt), arg0, arg1, arg2) -} - -// EstimateGas mocks base method. -func (m *MockEthClient) EstimateGas(arg0 context.Context, arg1 ethereum.CallMsg) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EstimateGas", arg0, arg1) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// EstimateGas indicates an expected call of EstimateGas. -func (mr *MockEthClientMockRecorder) EstimateGas(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EstimateGas", reflect.TypeOf((*MockEthClient)(nil).EstimateGas), arg0, arg1) -} - -// FeeHistory mocks base method. -func (m *MockEthClient) FeeHistory(arg0 context.Context, arg1 uint64, arg2 *big.Int, arg3 []float64) (*ethereum.FeeHistory, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FeeHistory", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*ethereum.FeeHistory) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FeeHistory indicates an expected call of FeeHistory. -func (mr *MockEthClientMockRecorder) FeeHistory(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeHistory", reflect.TypeOf((*MockEthClient)(nil).FeeHistory), arg0, arg1, arg2, arg3) -} - -// FilterLogs mocks base method. -func (m *MockEthClient) FilterLogs(arg0 context.Context, arg1 ethereum.FilterQuery) ([]types.Log, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FilterLogs", arg0, arg1) - ret0, _ := ret[0].([]types.Log) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FilterLogs indicates an expected call of FilterLogs. -func (mr *MockEthClientMockRecorder) FilterLogs(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterLogs", reflect.TypeOf((*MockEthClient)(nil).FilterLogs), arg0, arg1) -} - -// HeaderByHash mocks base method. -func (m *MockEthClient) HeaderByHash(arg0 context.Context, arg1 common.Hash) (*types.Header, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HeaderByHash", arg0, arg1) - ret0, _ := ret[0].(*types.Header) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// HeaderByHash indicates an expected call of HeaderByHash. -func (mr *MockEthClientMockRecorder) HeaderByHash(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByHash", reflect.TypeOf((*MockEthClient)(nil).HeaderByHash), arg0, arg1) -} - -// HeaderByNumber mocks base method. -func (m *MockEthClient) HeaderByNumber(arg0 context.Context, arg1 *big.Int) (*types.Header, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HeaderByNumber", arg0, arg1) - ret0, _ := ret[0].(*types.Header) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// HeaderByNumber indicates an expected call of HeaderByNumber. -func (mr *MockEthClientMockRecorder) HeaderByNumber(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeaderByNumber", reflect.TypeOf((*MockEthClient)(nil).HeaderByNumber), arg0, arg1) -} - -// NetworkID mocks base method. -func (m *MockEthClient) NetworkID(arg0 context.Context) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NetworkID", arg0) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// NetworkID indicates an expected call of NetworkID. -func (mr *MockEthClientMockRecorder) NetworkID(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkID", reflect.TypeOf((*MockEthClient)(nil).NetworkID), arg0) -} - -// NonceAt mocks base method. -func (m *MockEthClient) NonceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NonceAt", arg0, arg1, arg2) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// NonceAt indicates an expected call of NonceAt. -func (mr *MockEthClientMockRecorder) NonceAt(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NonceAt", reflect.TypeOf((*MockEthClient)(nil).NonceAt), arg0, arg1, arg2) -} - -// PeerCount mocks base method. -func (m *MockEthClient) PeerCount(arg0 context.Context) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PeerCount", arg0) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PeerCount indicates an expected call of PeerCount. -func (mr *MockEthClientMockRecorder) PeerCount(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerCount", reflect.TypeOf((*MockEthClient)(nil).PeerCount), arg0) -} - -// PendingBalanceAt mocks base method. -func (m *MockEthClient) PendingBalanceAt(arg0 context.Context, arg1 common.Address) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingBalanceAt", arg0, arg1) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingBalanceAt indicates an expected call of PendingBalanceAt. -func (mr *MockEthClientMockRecorder) PendingBalanceAt(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingBalanceAt", reflect.TypeOf((*MockEthClient)(nil).PendingBalanceAt), arg0, arg1) -} - -// PendingCallContract mocks base method. -func (m *MockEthClient) PendingCallContract(arg0 context.Context, arg1 ethereum.CallMsg) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingCallContract", arg0, arg1) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingCallContract indicates an expected call of PendingCallContract. -func (mr *MockEthClientMockRecorder) PendingCallContract(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingCallContract", reflect.TypeOf((*MockEthClient)(nil).PendingCallContract), arg0, arg1) -} - -// PendingCodeAt mocks base method. -func (m *MockEthClient) PendingCodeAt(arg0 context.Context, arg1 common.Address) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingCodeAt", arg0, arg1) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingCodeAt indicates an expected call of PendingCodeAt. -func (mr *MockEthClientMockRecorder) PendingCodeAt(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingCodeAt", reflect.TypeOf((*MockEthClient)(nil).PendingCodeAt), arg0, arg1) -} - -// PendingNonceAt mocks base method. -func (m *MockEthClient) PendingNonceAt(arg0 context.Context, arg1 common.Address) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingNonceAt", arg0, arg1) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingNonceAt indicates an expected call of PendingNonceAt. -func (mr *MockEthClientMockRecorder) PendingNonceAt(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingNonceAt", reflect.TypeOf((*MockEthClient)(nil).PendingNonceAt), arg0, arg1) -} - -// PendingStorageAt mocks base method. -func (m *MockEthClient) PendingStorageAt(arg0 context.Context, arg1 common.Address, arg2 common.Hash) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingStorageAt", arg0, arg1, arg2) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingStorageAt indicates an expected call of PendingStorageAt. -func (mr *MockEthClientMockRecorder) PendingStorageAt(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingStorageAt", reflect.TypeOf((*MockEthClient)(nil).PendingStorageAt), arg0, arg1, arg2) -} - -// PendingTransactionCount mocks base method. -func (m *MockEthClient) PendingTransactionCount(arg0 context.Context) (uint, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PendingTransactionCount", arg0) - ret0, _ := ret[0].(uint) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// PendingTransactionCount indicates an expected call of PendingTransactionCount. -func (mr *MockEthClientMockRecorder) PendingTransactionCount(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PendingTransactionCount", reflect.TypeOf((*MockEthClient)(nil).PendingTransactionCount), arg0) -} - -// SendTransaction mocks base method. -func (m *MockEthClient) SendTransaction(arg0 context.Context, arg1 *types.Transaction) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendTransaction", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendTransaction indicates an expected call of SendTransaction. -func (mr *MockEthClientMockRecorder) SendTransaction(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendTransaction", reflect.TypeOf((*MockEthClient)(nil).SendTransaction), arg0, arg1) -} - -// StorageAt mocks base method. -func (m *MockEthClient) StorageAt(arg0 context.Context, arg1 common.Address, arg2 common.Hash, arg3 *big.Int) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StorageAt", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StorageAt indicates an expected call of StorageAt. -func (mr *MockEthClientMockRecorder) StorageAt(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StorageAt", reflect.TypeOf((*MockEthClient)(nil).StorageAt), arg0, arg1, arg2, arg3) -} - -// SubscribeFilterLogs mocks base method. -func (m *MockEthClient) SubscribeFilterLogs(arg0 context.Context, arg1 ethereum.FilterQuery, arg2 chan<- types.Log) (ethereum.Subscription, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeFilterLogs", arg0, arg1, arg2) - ret0, _ := ret[0].(ethereum.Subscription) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SubscribeFilterLogs indicates an expected call of SubscribeFilterLogs. -func (mr *MockEthClientMockRecorder) SubscribeFilterLogs(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeFilterLogs", reflect.TypeOf((*MockEthClient)(nil).SubscribeFilterLogs), arg0, arg1, arg2) -} - -// SubscribeNewHead mocks base method. -func (m *MockEthClient) SubscribeNewHead(arg0 context.Context, arg1 chan<- *types.Header) (ethereum.Subscription, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeNewHead", arg0, arg1) - ret0, _ := ret[0].(ethereum.Subscription) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SubscribeNewHead indicates an expected call of SubscribeNewHead. -func (mr *MockEthClientMockRecorder) SubscribeNewHead(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeNewHead", reflect.TypeOf((*MockEthClient)(nil).SubscribeNewHead), arg0, arg1) -} - -// SuggestGasPrice mocks base method. -func (m *MockEthClient) SuggestGasPrice(arg0 context.Context) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SuggestGasPrice", arg0) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SuggestGasPrice indicates an expected call of SuggestGasPrice. -func (mr *MockEthClientMockRecorder) SuggestGasPrice(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SuggestGasPrice", reflect.TypeOf((*MockEthClient)(nil).SuggestGasPrice), arg0) -} - -// SuggestGasTipCap mocks base method. -func (m *MockEthClient) SuggestGasTipCap(arg0 context.Context) (*big.Int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SuggestGasTipCap", arg0) - ret0, _ := ret[0].(*big.Int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SuggestGasTipCap indicates an expected call of SuggestGasTipCap. -func (mr *MockEthClientMockRecorder) SuggestGasTipCap(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SuggestGasTipCap", reflect.TypeOf((*MockEthClient)(nil).SuggestGasTipCap), arg0) -} - -// SyncProgress mocks base method. -func (m *MockEthClient) SyncProgress(arg0 context.Context) (*ethereum.SyncProgress, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncProgress", arg0) - ret0, _ := ret[0].(*ethereum.SyncProgress) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SyncProgress indicates an expected call of SyncProgress. -func (mr *MockEthClientMockRecorder) SyncProgress(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncProgress", reflect.TypeOf((*MockEthClient)(nil).SyncProgress), arg0) -} - -// TransactionByHash mocks base method. -func (m *MockEthClient) TransactionByHash(arg0 context.Context, arg1 common.Hash) (*types.Transaction, bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TransactionByHash", arg0, arg1) - ret0, _ := ret[0].(*types.Transaction) - ret1, _ := ret[1].(bool) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// TransactionByHash indicates an expected call of TransactionByHash. -func (mr *MockEthClientMockRecorder) TransactionByHash(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByHash", reflect.TypeOf((*MockEthClient)(nil).TransactionByHash), arg0, arg1) -} - -// TransactionCount mocks base method. -func (m *MockEthClient) TransactionCount(arg0 context.Context, arg1 common.Hash) (uint, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TransactionCount", arg0, arg1) - ret0, _ := ret[0].(uint) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TransactionCount indicates an expected call of TransactionCount. -func (mr *MockEthClientMockRecorder) TransactionCount(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionCount", reflect.TypeOf((*MockEthClient)(nil).TransactionCount), arg0, arg1) -} - -// TransactionInBlock mocks base method. -func (m *MockEthClient) TransactionInBlock(arg0 context.Context, arg1 common.Hash, arg2 uint) (*types.Transaction, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TransactionInBlock", arg0, arg1, arg2) - ret0, _ := ret[0].(*types.Transaction) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TransactionInBlock indicates an expected call of TransactionInBlock. -func (mr *MockEthClientMockRecorder) TransactionInBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionInBlock", reflect.TypeOf((*MockEthClient)(nil).TransactionInBlock), arg0, arg1, arg2) -} - -// TransactionReceipt mocks base method. -func (m *MockEthClient) TransactionReceipt(arg0 context.Context, arg1 common.Hash) (*types.Receipt, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TransactionReceipt", arg0, arg1) - ret0, _ := ret[0].(*types.Receipt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TransactionReceipt indicates an expected call of TransactionReceipt. -func (mr *MockEthClientMockRecorder) TransactionReceipt(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionReceipt", reflect.TypeOf((*MockEthClient)(nil).TransactionReceipt), arg0, arg1) -} - -// TransactionSender mocks base method. -func (m *MockEthClient) TransactionSender(arg0 context.Context, arg1 *types.Transaction, arg2 common.Hash, arg3 uint) (common.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TransactionSender", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(common.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TransactionSender indicates an expected call of TransactionSender. -func (mr *MockEthClientMockRecorder) TransactionSender(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionSender", reflect.TypeOf((*MockEthClient)(nil).TransactionSender), arg0, arg1, arg2, arg3) -} diff --git a/chainio/mocks/eventSubscription.go b/chainio/mocks/eventSubscription.go deleted file mode 100644 index 953a5aa1..00000000 --- a/chainio/mocks/eventSubscription.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ethereum/go-ethereum/event (interfaces: Subscription) -// -// Generated by this command: -// -// mockgen -destination=./mocks/eventSubscription.go -package=mocks github.com/ethereum/go-ethereum/event Subscription -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - reflect "reflect" - - gomock "go.uber.org/mock/gomock" -) - -// MockSubscription is a mock of Subscription interface. -type MockSubscription struct { - ctrl *gomock.Controller - recorder *MockSubscriptionMockRecorder -} - -// MockSubscriptionMockRecorder is the mock recorder for MockSubscription. -type MockSubscriptionMockRecorder struct { - mock *MockSubscription -} - -// NewMockSubscription creates a new mock instance. -func NewMockSubscription(ctrl *gomock.Controller) *MockSubscription { - mock := &MockSubscription{ctrl: ctrl} - mock.recorder = &MockSubscriptionMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSubscription) EXPECT() *MockSubscriptionMockRecorder { - return m.recorder -} - -// Err mocks base method. -func (m *MockSubscription) Err() <-chan error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Err") - ret0, _ := ret[0].(<-chan error) - return ret0 -} - -// Err indicates an expected call of Err. -func (mr *MockSubscriptionMockRecorder) Err() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Err", reflect.TypeOf((*MockSubscription)(nil).Err)) -} - -// Unsubscribe mocks base method. -func (m *MockSubscription) Unsubscribe() { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Unsubscribe") -} - -// Unsubscribe indicates an expected call of Unsubscribe. -func (mr *MockSubscriptionMockRecorder) Unsubscribe() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unsubscribe", reflect.TypeOf((*MockSubscription)(nil).Unsubscribe)) -} diff --git a/chainio/txmgr/txmgr.go b/chainio/txmgr/txmgr.go index 5df7da23..d237840d 100644 --- a/chainio/txmgr/txmgr.go +++ b/chainio/txmgr/txmgr.go @@ -6,7 +6,6 @@ import ( "math/big" "time" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum/go-ethereum" @@ -38,9 +37,15 @@ type TxManager interface { GetNoSendTxOpts() (*bind.TransactOpts, error) } +type ethClient interface { + SuggestGasTipCap(ctx context.Context) (*big.Int, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) +} + type SimpleTxManager struct { wallet wallet.Wallet - client eth.Client + client ethClient log logging.Logger sender common.Address gasLimitMultiplier float64 @@ -52,7 +57,7 @@ var _ TxManager = (*SimpleTxManager)(nil) // to send a transaction to smart contracts on the Ethereum node func NewSimpleTxManager( wallet wallet.Wallet, - client eth.Client, + client ethClient, log logging.Logger, sender common.Address, ) *SimpleTxManager { diff --git a/internal/fakes/avs_registry.go b/internal/fakes/avs_registry.go new file mode 100644 index 00000000..e17ce7f9 --- /dev/null +++ b/internal/fakes/avs_registry.go @@ -0,0 +1,100 @@ +package fakes + +import ( + "context" + "math/big" + + apkregistrybindings "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" + opstateretriever "github.com/Layr-Labs/eigensdk-go/contracts/bindings/OperatorStateRetriever" + "github.com/Layr-Labs/eigensdk-go/types" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" +) + +type TestOperator struct { + OperatorAddr common.Address + OperatorInfo types.OperatorInfo + ContractG1Pubkey apkregistrybindings.BN254G1Point + ContractG2Pubkey apkregistrybindings.BN254G2Point + OperatorId types.OperatorId +} + +type FakeAVSRegistryReader struct { + opAddress []types.OperatorAddr + opPubKeys []types.OperatorPubkeys + operatorId types.OperatorId + socket types.Socket + err error +} + +func NewFakeAVSRegistryReader( + opr *TestOperator, + err error, +) *FakeAVSRegistryReader { + if opr == nil { + return &FakeAVSRegistryReader{} + } + return &FakeAVSRegistryReader{ + opAddress: []common.Address{opr.OperatorAddr}, + opPubKeys: []types.OperatorPubkeys{opr.OperatorInfo.Pubkeys}, + socket: opr.OperatorInfo.Socket, + operatorId: opr.OperatorId, + err: err, + } +} + +func (f *FakeAVSRegistryReader) QueryExistingRegisteredOperatorPubKeys( + ctx context.Context, + startBlock *big.Int, + stopBlock *big.Int, + blockRange *big.Int, +) ([]types.OperatorAddr, []types.OperatorPubkeys, error) { + return f.opAddress, f.opPubKeys, f.err +} + +func (f *FakeAVSRegistryReader) QueryExistingRegisteredOperatorSockets( + ctx context.Context, + startBlock *big.Int, + stopBlock *big.Int, + blockRange *big.Int, +) (map[types.OperatorId]types.Socket, error) { + if len(f.opPubKeys) == 0 { + return nil, nil + } + + return map[types.OperatorId]types.Socket{ + types.OperatorIdFromG1Pubkey(f.opPubKeys[0].G1Pubkey): f.socket, + }, nil +} + +func (f *FakeAVSRegistryReader) GetOperatorFromId( + opts *bind.CallOpts, + operatorId types.OperatorId, +) (common.Address, error) { + return f.opAddress[0], f.err +} + +func (f *FakeAVSRegistryReader) GetOperatorsStakeInQuorumsAtBlock( + opts *bind.CallOpts, + quorumNumbers types.QuorumNums, + blockNumber types.BlockNum, +) ([][]opstateretriever.OperatorStateRetrieverOperator, error) { + return [][]opstateretriever.OperatorStateRetrieverOperator{ + { + { + OperatorId: f.operatorId, + Stake: big.NewInt(123), + }, + }, + }, nil +} + +func (f *FakeAVSRegistryReader) GetCheckSignaturesIndices( + opts *bind.CallOpts, + referenceBlockNumber uint32, + quorumNumbers types.QuorumNums, + nonSignerOperatorIds []types.OperatorId, +) (opstateretriever.OperatorStateRetrieverCheckSignaturesIndices, error) { + return opstateretriever.OperatorStateRetrieverCheckSignaturesIndices{}, nil +} diff --git a/internal/fakes/eth_client.go b/internal/fakes/eth_client.go new file mode 100644 index 00000000..7c167443 --- /dev/null +++ b/internal/fakes/eth_client.go @@ -0,0 +1,95 @@ +package fakes + +import ( + "context" + "errors" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "math/big" +) + +const ( + TransactionHash = "0x0000000000000000000000000000000000000000000000000000000000001234" + TransactionNashNotInFake = "0xabcd" + BlockNumber = 1234 +) + +type EthClient struct { + chainId *big.Int + successfulTxs map[common.Hash]bool +} + +// NewEthClient returns a new instance of the EthClient +// Right now this client is hardcoded with some values to satisfy current +// testing requirements, but it can be extended to support more features and +// can be made more generic over time when we add more tests. +// Currently used in +// - chainio/clients/wallet/fireblocks_wallet_test.go +func NewEthClient() *EthClient { + return &EthClient{ + chainId: big.NewInt(5), + successfulTxs: map[common.Hash]bool{ + common.HexToHash(TransactionHash): true, + }, + } +} + +func (f *EthClient) ChainID(ctx context.Context) (*big.Int, error) { + return f.chainId, nil +} + +func (f *EthClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { + if _, ok := f.successfulTxs[txHash]; !ok { + return nil, errors.New("tx not found") + } + + return &types.Receipt{ + TxHash: txHash, + BlockNumber: big.NewInt(BlockNumber), + }, nil +} + +func (f *EthClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) { + return []byte{}, nil +} + +func (f *EthClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + return []byte{}, nil +} + +func (f *EthClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { + return 0, nil +} + +func (f *EthClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) { + return big.NewInt(0), nil +} + +func (f *EthClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { + return big.NewInt(0), nil +} + +func (f *EthClient) SendTransaction(ctx context.Context, tx *types.Transaction) error { + return nil +} + +func (f *EthClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { + return &types.Header{}, nil +} + +func (f *EthClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { + return []byte{}, nil +} + +func (f *EthClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { + return 0, nil +} + +func (f *EthClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { + return []types.Log{}, nil +} + +func (f *EthClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { + return nil, nil +} diff --git a/logging/gen.go b/logging/gen.go deleted file mode 100644 index ef6269cf..00000000 --- a/logging/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package logging - -//go:generate mockgen -destination=mocks/mock_logger.go -package=mocks github.com/Layr-Labs/eigensdk-go/logging Logger diff --git a/logging/mocks/mock_logger.go b/logging/mocks/mock_logger.go deleted file mode 100644 index 31747a1a..00000000 --- a/logging/mocks/mock_logger.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/logging (interfaces: Logger) -// -// Generated by this command: -// -// mockgen -destination=mocks/mock_logger.go -package=mocks github.com/Layr-Labs/eigensdk-go/logging Logger -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - reflect "reflect" - - logging "github.com/Layr-Labs/eigensdk-go/logging" - gomock "go.uber.org/mock/gomock" -) - -// MockLogger is a mock of Logger interface. -type MockLogger struct { - ctrl *gomock.Controller - recorder *MockLoggerMockRecorder -} - -// MockLoggerMockRecorder is the mock recorder for MockLogger. -type MockLoggerMockRecorder struct { - mock *MockLogger -} - -// NewMockLogger creates a new mock instance. -func NewMockLogger(ctrl *gomock.Controller) *MockLogger { - mock := &MockLogger{ctrl: ctrl} - mock.recorder = &MockLoggerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { - return m.recorder -} - -// Debug mocks base method. -func (m *MockLogger) Debug(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Debug", varargs...) -} - -// Debug indicates an expected call of Debug. -func (mr *MockLoggerMockRecorder) Debug(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debug", reflect.TypeOf((*MockLogger)(nil).Debug), varargs...) -} - -// Debugf mocks base method. -func (m *MockLogger) Debugf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Debugf", varargs...) -} - -// Debugf indicates an expected call of Debugf. -func (mr *MockLoggerMockRecorder) Debugf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debugf", reflect.TypeOf((*MockLogger)(nil).Debugf), varargs...) -} - -// Error mocks base method. -func (m *MockLogger) Error(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockLoggerMockRecorder) Error(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), varargs...) -} - -// Errorf mocks base method. -func (m *MockLogger) Errorf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Errorf", varargs...) -} - -// Errorf indicates an expected call of Errorf. -func (mr *MockLoggerMockRecorder) Errorf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Errorf", reflect.TypeOf((*MockLogger)(nil).Errorf), varargs...) -} - -// Fatal mocks base method. -func (m *MockLogger) Fatal(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Fatal", varargs...) -} - -// Fatal indicates an expected call of Fatal. -func (mr *MockLoggerMockRecorder) Fatal(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fatal", reflect.TypeOf((*MockLogger)(nil).Fatal), varargs...) -} - -// Fatalf mocks base method. -func (m *MockLogger) Fatalf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Fatalf", varargs...) -} - -// Fatalf indicates an expected call of Fatalf. -func (mr *MockLoggerMockRecorder) Fatalf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fatalf", reflect.TypeOf((*MockLogger)(nil).Fatalf), varargs...) -} - -// Info mocks base method. -func (m *MockLogger) Info(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockLoggerMockRecorder) Info(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), varargs...) -} - -// Infof mocks base method. -func (m *MockLogger) Infof(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Infof", varargs...) -} - -// Infof indicates an expected call of Infof. -func (mr *MockLoggerMockRecorder) Infof(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Infof", reflect.TypeOf((*MockLogger)(nil).Infof), varargs...) -} - -// Warn mocks base method. -func (m *MockLogger) Warn(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Warn", varargs...) -} - -// Warn indicates an expected call of Warn. -func (mr *MockLoggerMockRecorder) Warn(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), varargs...) -} - -// Warnf mocks base method. -func (m *MockLogger) Warnf(arg0 string, arg1 ...any) { - m.ctrl.T.Helper() - varargs := []any{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Warnf", varargs...) -} - -// Warnf indicates an expected call of Warnf. -func (mr *MockLoggerMockRecorder) Warnf(arg0 any, arg1 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warnf", reflect.TypeOf((*MockLogger)(nil).Warnf), varargs...) -} - -// With mocks base method. -func (m *MockLogger) With(arg0 ...any) logging.Logger { - m.ctrl.T.Helper() - varargs := []any{} - for _, a := range arg0 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "With", varargs...) - ret0, _ := ret[0].(logging.Logger) - return ret0 -} - -// With indicates an expected call of With. -func (mr *MockLoggerMockRecorder) With(arg0 ...any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockLogger)(nil).With), arg0...) -} diff --git a/logging/noop_logger.go b/logging/noop_logger.go deleted file mode 100644 index 7af1db0b..00000000 --- a/logging/noop_logger.go +++ /dev/null @@ -1,43 +0,0 @@ -package logging - -type NoopLogger struct{} - -var _ Logger = (*NoopLogger)(nil) - -func NewNoopLogger() Logger { - return &NoopLogger{} -} - -func (l *NoopLogger) Debug(msg string, tags ...any) {} - -func (l *NoopLogger) Info(msg string, tags ...any) {} - -func (l *NoopLogger) Warn(msg string, tags ...any) {} - -func (l *NoopLogger) Error(msg string, tags ...any) {} - -func (l *NoopLogger) Fatal(msg string, tags ...any) {} - -func (l *NoopLogger) Debugm(msg string, tags map[string]any) {} - -func (l *NoopLogger) Infom(msg string, tags map[string]any) {} - -func (l *NoopLogger) Warnm(msg string, tags map[string]any) {} - -func (l *NoopLogger) Errorm(msg string, tags map[string]any) {} - -func (l *NoopLogger) Fatalm(msg string, tags map[string]any) {} - -func (l *NoopLogger) Debugf(template string, args ...interface{}) {} - -func (l *NoopLogger) Infof(template string, args ...interface{}) {} - -func (l *NoopLogger) Warnf(template string, args ...interface{}) {} - -func (l *NoopLogger) Errorf(template string, args ...interface{}) {} - -func (l *NoopLogger) Fatalf(template string, args ...interface{}) {} - -func (l *NoopLogger) With(tags ...any) Logger { - return l -} diff --git a/logging/slog_logger.go b/logging/slog_logger.go index d457935e..43490a1f 100644 --- a/logging/slog_logger.go +++ b/logging/slog_logger.go @@ -42,17 +42,32 @@ type SLoggerOptions struct { NoColor bool } +// default SLogger options are used when no options are provided +// they are the development options (debug logs with source) +var defaultTintOptions = tint.Options{ + AddSource: false, + Level: slog.LevelInfo, + ReplaceAttr: nil, + TimeFormat: time.StampMilli, + NoColor: false, +} + // NewSlogTextLogger creates a new SLogger with a text handler // Default behavior is colored log outputs. To disable colors, set opts.NoColor to true. func NewTextSLogger(outputWriter io.Writer, opts *SLoggerOptions) *SLogger { - tintOptions := &tint.Options{ - AddSource: opts.AddSource, - Level: opts.Level, - ReplaceAttr: opts.ReplaceAttr, - TimeFormat: opts.TimeFormat, - NoColor: opts.NoColor, + var tintOptions tint.Options + if opts == nil { + tintOptions = defaultTintOptions + } else { + tintOptions = tint.Options{ + AddSource: opts.AddSource, + Level: opts.Level, + ReplaceAttr: opts.ReplaceAttr, + TimeFormat: opts.TimeFormat, + NoColor: opts.NoColor, + } } - handler := tint.NewHandler(outputWriter, tintOptions) + handler := tint.NewHandler(outputWriter, &tintOptions) logger := slog.New(handler) return &SLogger{ logger, @@ -63,10 +78,15 @@ func NewTextSLogger(outputWriter io.Writer, opts *SLoggerOptions) *SLogger { // Currently colors are not supported with json handler. If colors are required, // use NewTextSLogger instead. func NewJsonSLogger(outputWriter io.Writer, opts *SLoggerOptions) *SLogger { - handlerOpts := &slog.HandlerOptions{ - AddSource: opts.AddSource, - Level: opts.Level, - ReplaceAttr: opts.ReplaceAttr, + var handlerOpts *slog.HandlerOptions + if opts == nil { + handlerOpts = &slog.HandlerOptions{} + } else { + handlerOpts = &slog.HandlerOptions{ + AddSource: opts.AddSource, + Level: opts.Level, + ReplaceAttr: opts.ReplaceAttr, + } } handler := slog.NewJSONHandler(outputWriter, handlerOpts) logger := slog.New(handler) diff --git a/metrics/collectors/economic/economic.go b/metrics/collectors/economic/economic.go index 533e4d37..5ab8dec5 100644 --- a/metrics/collectors/economic/economic.go +++ b/metrics/collectors/economic/economic.go @@ -5,8 +5,6 @@ import ( "errors" "strconv" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/eigensdk-go/utils" @@ -15,6 +13,19 @@ import ( "github.com/prometheus/client_golang/prometheus" ) +type eLReader interface { + OperatorIsFrozen(opts *bind.CallOpts, operatorAddr common.Address) (bool, error) +} + +type avsRegistryReader interface { + GetOperatorId(opts *bind.CallOpts, operatorAddr common.Address) ([32]byte, error) + + GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock( + opts *bind.CallOpts, + operatorId types.OperatorId, + ) (map[types.QuorumNum]types.StakeAmount, error) +} + // Collector exports the economic metrics listed at // // https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/metrics/metrics-prom-spec#economics-metrics @@ -25,8 +36,8 @@ import ( // so that they are exported on the same port type Collector struct { // TODO(samlaf): we use a chain as the backend for now, but should eventually move to a subgraph - elReader elcontracts.Reader - avsRegistryReader avsregistry.Reader + elReader eLReader + avsRegistryReader avsRegistryReader logger logging.Logger // params to query the metrics for operatorAddr common.Address @@ -62,9 +73,12 @@ type Collector struct { var _ prometheus.Collector = (*Collector)(nil) func NewCollector( - elReader elcontracts.Reader, avsRegistryReader avsregistry.Reader, - avsName string, logger logging.Logger, - operatorAddr common.Address, quorumNames map[types.QuorumNum]string, + elReader eLReader, + avsRegistryReader avsRegistryReader, + avsName string, + logger logging.Logger, + operatorAddr common.Address, + quorumNames map[types.QuorumNum]string, ) *Collector { return &Collector{ elReader: elReader, diff --git a/metrics/collectors/economic/economic_test.go b/metrics/collectors/economic/economic_test.go index 23bc831d..4e1ed81b 100644 --- a/metrics/collectors/economic/economic_test.go +++ b/metrics/collectors/economic/economic_test.go @@ -4,19 +4,65 @@ import ( "math/big" "testing" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" - "github.com/Layr-Labs/eigensdk-go/chainio/mocks" - "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/testutils" "github.com/Layr-Labs/eigensdk-go/types" ) -func TestEconomicCollector(t *testing.T) { - operatorAddr := common.HexToAddress("0x0") +const registeredOpAddress = "0xb81b18c988bfc7d131fca985a9c531f325e98a2f" + +type fakeELReader struct { + registeredOperators map[common.Address]bool +} + +func newFakeELReader() *fakeELReader { + registeredOperators := make(map[common.Address]bool) + registeredOperators[common.HexToAddress(registeredOpAddress)] = false + return &fakeELReader{ + registeredOperators: registeredOperators, + } +} + +func (f *fakeELReader) OperatorIsFrozen(opts *bind.CallOpts, operatorAddr common.Address) (bool, error) { + return f.registeredOperators[operatorAddr], nil +} + +type fakeAVSRegistryReader struct { + operatorId types.OperatorId + stakes map[types.QuorumNum]*big.Int +} + +func (f *fakeAVSRegistryReader) GetOperatorId(opts *bind.CallOpts, operatorAddr common.Address) ([32]byte, error) { + return f.operatorId, nil +} + +func (f *fakeAVSRegistryReader) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock( + opts *bind.CallOpts, + operatorId types.OperatorId, +) (map[types.QuorumNum]*big.Int, error) { + return f.stakes, nil +} + +func newFakeAVSRegistryReader() *fakeAVSRegistryReader { operatorId := types.OperatorId{1} + stakes := map[types.QuorumNum]*big.Int{ + 0: big.NewInt(1000), + 1: big.NewInt(2000), + } + return &fakeAVSRegistryReader{ + operatorId: operatorId, + stakes: stakes, + } +} + +func TestEconomicCollector(t *testing.T) { + operatorAddr := common.HexToAddress(registeredOpAddress) quorumNames := map[types.QuorumNum]string{ 0: "ethQuorum", 1: "someOtherTokenQuorum", @@ -25,20 +71,10 @@ func TestEconomicCollector(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - elReader := mocks.NewMockELReader(mockCtrl) - elReader.EXPECT().OperatorIsFrozen(gomock.Any(), operatorAddr).Return(false, nil) - - avsRegistryReader := mocks.NewMockAVSReader(mockCtrl) - avsRegistryReader.EXPECT().GetOperatorId(gomock.Any(), operatorAddr).Return(operatorId, nil) - avsRegistryReader.EXPECT().GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(gomock.Any(), gomock.Any()).Return( - map[types.QuorumNum]*big.Int{ - 0: big.NewInt(1000), - 1: big.NewInt(2000), - }, - nil, - ) + elReader := newFakeELReader() + avsRegistryReader := newFakeAVSRegistryReader() - logger := logging.NewNoopLogger() + logger := testutils.GetTestLogger() economicCollector := NewCollector(elReader, avsRegistryReader, "testavs", logger, operatorAddr, quorumNames) count := testutil.CollectAndCount(economicCollector, "eigen_slashing_status", "eigen_registered_stakes") diff --git a/metrics/eigenmetrics_test.go b/metrics/eigenmetrics_test.go index cfd4d301..ab1acbfe 100644 --- a/metrics/eigenmetrics_test.go +++ b/metrics/eigenmetrics_test.go @@ -7,12 +7,13 @@ import ( "testing" "time" + "github.com/Layr-Labs/eigensdk-go/testutils" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - - "github.com/Layr-Labs/eigensdk-go/logging" ) type MetricsTestSuite struct { @@ -23,7 +24,7 @@ type MetricsTestSuite struct { // this runs before all tests to initialize reg and metrics func (suite *MetricsTestSuite) SetupTest() { - logger := logging.NewNoopLogger() + logger := testutils.GetTestLogger() // create and start the metrics server suite.reg = prometheus.NewRegistry() suite.metrics = NewEigenMetrics("testavs", "localhost:9090", suite.reg, logger) diff --git a/nodeapi/nodeapi_test.go b/nodeapi/nodeapi_test.go index a3012c2f..dadb8176 100644 --- a/nodeapi/nodeapi_test.go +++ b/nodeapi/nodeapi_test.go @@ -7,13 +7,13 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/Layr-Labs/eigensdk-go/testutils" - "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/stretchr/testify/assert" ) -var noopLogger = logging.NewNoopLogger() -var testNodeApi = NewNodeApi("testAvs", "v0.0.1", "localhost:8080", noopLogger) +var logger = testutils.GetTestLogger() +var testNodeApi = NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger) // just making sure that the nodeapi starts without any errors func TestStart(t *testing.T) { @@ -56,7 +56,7 @@ func TestHealthHandler(t *testing.T) { }, "partially healthy": { nodeApi: func() *NodeApi { - nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", noopLogger) + nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger) nodeApi.UpdateHealth(PartiallyHealthy) return nodeApi }(), @@ -65,7 +65,7 @@ func TestHealthHandler(t *testing.T) { }, "unhealthy": { nodeApi: func() *NodeApi { - nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", noopLogger) + nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger) nodeApi.UpdateHealth(Unhealthy) return nodeApi }(), @@ -106,7 +106,7 @@ func TestServicesHandler(t *testing.T) { }, "one service": { nodeApi: func() *NodeApi { - nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", noopLogger) + nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger) nodeApi.RegisterNewService("testServiceId", "testServiceName", "testServiceDescription", ServiceStatusUp) return nodeApi }(), @@ -115,7 +115,7 @@ func TestServicesHandler(t *testing.T) { }, "two services": { nodeApi: func() *NodeApi { - nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", noopLogger) + nodeApi := NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger) nodeApi.RegisterNewService("testServiceId", "testServiceName", "testServiceDescription", ServiceStatusUp) nodeApi.RegisterNewService("testServiceId2", "testServiceName2", "testServiceDescription2", ServiceStatusDown) return nodeApi diff --git a/services/avsregistry/avsregistry_chaincaller.go b/services/avsregistry/avsregistry_chaincaller.go index 7bdddb5a..7b3601e3 100644 --- a/services/avsregistry/avsregistry_chaincaller.go +++ b/services/avsregistry/avsregistry_chaincaller.go @@ -3,9 +3,10 @@ package avsregistry import ( "context" "fmt" + opstateretriever "github.com/Layr-Labs/eigensdk-go/contracts/bindings/OperatorStateRetriever" + "github.com/ethereum/go-ethereum/common" "math/big" - avsregistry "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/logging" opinfoservice "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo" @@ -14,19 +15,39 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" ) +type avsRegistryReader interface { + GetOperatorsStakeInQuorumsAtBlock( + opts *bind.CallOpts, + quorumNumbers types.QuorumNums, + blockNumber types.BlockNum, + ) ([][]opstateretriever.OperatorStateRetrieverOperator, error) + + GetOperatorFromId( + opts *bind.CallOpts, + operatorId types.OperatorId, + ) (common.Address, error) + + GetCheckSignaturesIndices( + opts *bind.CallOpts, + referenceBlockNumber uint32, + quorumNumbers types.QuorumNums, + nonSignerOperatorIds []types.OperatorId, + ) (opstateretriever.OperatorStateRetrieverCheckSignaturesIndices, error) +} + // AvsRegistryServiceChainCaller is a wrapper around Reader that transforms the data into // nicer golang types that are easier to work with type AvsRegistryServiceChainCaller struct { - avsregistry.Reader + avsRegistryReader operatorInfoService opinfoservice.OperatorsInfoService logger logging.Logger } var _ AvsRegistryService = (*AvsRegistryServiceChainCaller)(nil) -func NewAvsRegistryServiceChainCaller(avsRegistryReader avsregistry.Reader, operatorInfoService opinfoservice.OperatorsInfoService, logger logging.Logger) *AvsRegistryServiceChainCaller { +func NewAvsRegistryServiceChainCaller(reader avsRegistryReader, operatorInfoService opinfoservice.OperatorsInfoService, logger logging.Logger) *AvsRegistryServiceChainCaller { return &AvsRegistryServiceChainCaller{ - Reader: avsRegistryReader, + avsRegistryReader: reader, operatorInfoService: operatorInfoService, logger: logger, } @@ -35,7 +56,7 @@ func NewAvsRegistryServiceChainCaller(avsRegistryReader avsregistry.Reader, oper func (ar *AvsRegistryServiceChainCaller) GetOperatorsAvsStateAtBlock(ctx context.Context, quorumNumbers types.QuorumNums, blockNumber types.BlockNum) (map[types.OperatorId]types.OperatorAvsState, error) { operatorsAvsState := make(map[types.OperatorId]types.OperatorAvsState) // Get operator state for each quorum by querying BLSOperatorStateRetriever (this call is why this service implementation is called ChainCaller) - operatorsStakesInQuorums, err := ar.Reader.GetOperatorsStakeInQuorumsAtBlock(&bind.CallOpts{Context: ctx}, quorumNumbers, blockNumber) + operatorsStakesInQuorums, err := ar.avsRegistryReader.GetOperatorsStakeInQuorumsAtBlock(&bind.CallOpts{Context: ctx}, quorumNumbers, blockNumber) if err != nil { return nil, utils.WrapError("Failed to get operator state", err) } @@ -96,7 +117,7 @@ func (ar *AvsRegistryServiceChainCaller) GetQuorumsAvsStateAtBlock(ctx context.C } func (ar *AvsRegistryServiceChainCaller) getOperatorInfo(ctx context.Context, operatorId types.OperatorId) (types.OperatorInfo, error) { - operatorAddr, err := ar.Reader.GetOperatorFromId(&bind.CallOpts{Context: ctx}, operatorId) + operatorAddr, err := ar.avsRegistryReader.GetOperatorFromId(&bind.CallOpts{Context: ctx}, operatorId) if err != nil { return types.OperatorInfo{}, utils.WrapError("Failed to get operator address from pubkey hash", err) } diff --git a/services/avsregistry/avsregistry_chaincaller_test.go b/services/avsregistry/avsregistry_chaincaller_test.go index 8b2cbde0..5da31fd2 100644 --- a/services/avsregistry/avsregistry_chaincaller_test.go +++ b/services/avsregistry/avsregistry_chaincaller_test.go @@ -2,32 +2,40 @@ package avsregistry import ( "context" + "errors" + "math/big" "reflect" "testing" - chainiomocks "github.com/Layr-Labs/eigensdk-go/chainio/mocks" - opstateretrievar "github.com/Layr-Labs/eigensdk-go/contracts/bindings/OperatorStateRetriever" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - "github.com/Layr-Labs/eigensdk-go/logging" - servicemocks "github.com/Layr-Labs/eigensdk-go/services/mocks" + "github.com/Layr-Labs/eigensdk-go/internal/fakes" + "github.com/Layr-Labs/eigensdk-go/testutils" "github.com/Layr-Labs/eigensdk-go/types" + "github.com/ethereum/go-ethereum/common" - "go.uber.org/mock/gomock" ) -type testOperator struct { - operatorAddr common.Address - operatorId types.OperatorId +type fakeOperatorInfoService struct { operatorInfo types.OperatorInfo } +func newFakeOperatorInfoService(operatorInfo types.OperatorInfo) *fakeOperatorInfoService { + return &fakeOperatorInfoService{ + operatorInfo: operatorInfo, + } +} + +func (f *fakeOperatorInfoService) GetOperatorInfo(ctx context.Context, operator common.Address) (operatorInfo types.OperatorInfo, operatorFound bool) { + return f.operatorInfo, true +} + func TestAvsRegistryServiceChainCaller_getOperatorPubkeys(t *testing.T) { - logger := logging.NewNoopLogger() - testOperator := testOperator{ - operatorAddr: common.HexToAddress("0x1"), - operatorId: types.OperatorId{1}, - operatorInfo: types.OperatorInfo{ + logger := testutils.GetTestLogger() + testOperator1 := fakes.TestOperator{ + OperatorAddr: common.HexToAddress("0x1"), + OperatorId: types.OperatorId{1}, + OperatorInfo: types.OperatorInfo{ Pubkeys: types.OperatorPubkeys{ G1Pubkey: bls.NewG1Point(big.NewInt(1), big.NewInt(1)), G2Pubkey: bls.NewG2Point([2]*big.Int{big.NewInt(1), big.NewInt(1)}, [2]*big.Int{big.NewInt(1), big.NewInt(1)}), @@ -38,40 +46,33 @@ func TestAvsRegistryServiceChainCaller_getOperatorPubkeys(t *testing.T) { // TODO(samlaf): add error test cases var tests = []struct { - name string - mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) - queryOperatorId types.OperatorId - wantErr error - wantOperatorInfo types.OperatorInfo + name string + operator *fakes.TestOperator + queryOperatorId types.OperatorId + wantErr error + wantOperatorInfo types.OperatorInfo }{ { - name: "should return operator info", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { - mockAvsRegistryReader.EXPECT().GetOperatorFromId(gomock.Any(), testOperator.operatorId).Return(testOperator.operatorAddr, nil) - mockOperatorsInfoService.EXPECT().GetOperatorInfo(gomock.Any(), testOperator.operatorAddr).Return(testOperator.operatorInfo, true) - }, - queryOperatorId: testOperator.operatorId, + name: "should return operator info", + operator: &testOperator1, + queryOperatorId: testOperator1.OperatorId, wantErr: nil, - wantOperatorInfo: testOperator.operatorInfo, + wantOperatorInfo: testOperator1.OperatorInfo, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create mocks - mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) - mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) + mockAvsRegistryReader := fakes.NewFakeAVSRegistryReader(tt.operator, nil) + mockOperatorsInfoService := newFakeOperatorInfoService(tt.operator.OperatorInfo) - if tt.mocksInitializationFunc != nil { - tt.mocksInitializationFunc(mockAvsRegistryReader, mockOperatorsInfoService) - } // Create a new instance of the avsregistry service service := NewAvsRegistryServiceChainCaller(mockAvsRegistryReader, mockOperatorsInfoService, logger) // Call the GetOperatorPubkeys method with the test operator address gotOperatorInfo, gotErr := service.getOperatorInfo(context.Background(), tt.queryOperatorId) - if tt.wantErr != gotErr { + if !errors.Is(gotErr, tt.wantErr) { t.Fatalf("GetOperatorPubkeys returned wrong error. Got: %v, want: %v.", gotErr, tt.wantErr) } if tt.wantErr == nil && !reflect.DeepEqual(tt.wantOperatorInfo, gotOperatorInfo) { @@ -82,11 +83,11 @@ func TestAvsRegistryServiceChainCaller_getOperatorPubkeys(t *testing.T) { } func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { - logger := logging.NewNoopLogger() - testOperator := testOperator{ - operatorAddr: common.HexToAddress("0x1"), - operatorId: types.OperatorId{1}, - operatorInfo: types.OperatorInfo{ + logger := testutils.GetTestLogger() + testOperator1 := fakes.TestOperator{ + OperatorAddr: common.HexToAddress("0x1"), + OperatorId: types.OperatorId{1}, + OperatorInfo: types.OperatorInfo{ Pubkeys: types.OperatorPubkeys{ G1Pubkey: bls.NewG1Point(big.NewInt(1), big.NewInt(1)), G2Pubkey: bls.NewG2Point([2]*big.Int{big.NewInt(1), big.NewInt(1)}, [2]*big.Int{big.NewInt(1), big.NewInt(1)}), @@ -97,33 +98,22 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { var tests = []struct { name string - mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) queryQuorumNumbers types.QuorumNums queryBlockNum types.BlockNum wantErr error wantOperatorsAvsStateDict map[types.OperatorId]types.OperatorAvsState + operator *fakes.TestOperator }{ { - name: "should return operatorsAvsState", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { - mockAvsRegistryReader.EXPECT().GetOperatorsStakeInQuorumsAtBlock(gomock.Any(), types.QuorumNums{1}, types.BlockNum(1)).Return([][]opstateretrievar.OperatorStateRetrieverOperator{ - { - { - OperatorId: testOperator.operatorId, - Stake: big.NewInt(123), - }, - }, - }, nil) - mockAvsRegistryReader.EXPECT().GetOperatorFromId(gomock.Any(), testOperator.operatorId).Return(testOperator.operatorAddr, nil) - mockOperatorsInfoService.EXPECT().GetOperatorInfo(gomock.Any(), testOperator.operatorAddr).Return(testOperator.operatorInfo, true) - }, + name: "should return operatorsAvsState", queryQuorumNumbers: types.QuorumNums{1}, + operator: &testOperator1, queryBlockNum: 1, wantErr: nil, wantOperatorsAvsStateDict: map[types.OperatorId]types.OperatorAvsState{ - testOperator.operatorId: { - OperatorId: testOperator.operatorId, - OperatorInfo: testOperator.operatorInfo, + testOperator1.OperatorId: { + OperatorId: testOperator1.OperatorId, + OperatorInfo: testOperator1.OperatorInfo, StakePerQuorum: map[types.QuorumNum]types.StakeAmount{1: big.NewInt(123)}, BlockNumber: 1, }, @@ -134,19 +124,15 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create mocks - mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) - mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) + mockAvsRegistryReader := fakes.NewFakeAVSRegistryReader(tt.operator, nil) + mockOperatorsInfoService := newFakeOperatorInfoService(tt.operator.OperatorInfo) - if tt.mocksInitializationFunc != nil { - tt.mocksInitializationFunc(mockAvsRegistryReader, mockOperatorsInfoService) - } // Create a new instance of the avsregistry service service := NewAvsRegistryServiceChainCaller(mockAvsRegistryReader, mockOperatorsInfoService, logger) // Call the GetOperatorPubkeys method with the test operator address gotOperatorsAvsStateDict, gotErr := service.GetOperatorsAvsStateAtBlock(context.Background(), tt.queryQuorumNumbers, tt.queryBlockNum) - if tt.wantErr != gotErr { + if !errors.Is(gotErr, tt.wantErr) { t.Fatalf("GetOperatorsAvsState returned wrong error. Got: %v, want: %v.", gotErr, tt.wantErr) } if tt.wantErr == nil && !reflect.DeepEqual(tt.wantOperatorsAvsStateDict, gotOperatorsAvsStateDict) { @@ -157,11 +143,11 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { } func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { - logger := logging.NewNoopLogger() - testOperator := testOperator{ - operatorAddr: common.HexToAddress("0x1"), - operatorId: types.OperatorId{1}, - operatorInfo: types.OperatorInfo{ + logger := testutils.GetTestLogger() + testOperator1 := fakes.TestOperator{ + OperatorAddr: common.HexToAddress("0x1"), + OperatorId: types.OperatorId{1}, + OperatorInfo: types.OperatorInfo{ Pubkeys: types.OperatorPubkeys{ G1Pubkey: bls.NewG1Point(big.NewInt(1), big.NewInt(1)), G2Pubkey: bls.NewG2Point([2]*big.Int{big.NewInt(1), big.NewInt(1)}, [2]*big.Int{big.NewInt(1), big.NewInt(1)}), @@ -172,27 +158,16 @@ func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { var tests = []struct { name string - mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) queryQuorumNumbers types.QuorumNums queryBlockNum types.BlockNum wantErr error wantQuorumsAvsStateDict map[types.QuorumNum]types.QuorumAvsState + operator *fakes.TestOperator }{ { - name: "should return operatorsAvsState", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { - mockAvsRegistryReader.EXPECT().GetOperatorsStakeInQuorumsAtBlock(gomock.Any(), types.QuorumNums{1}, types.BlockNum(1)).Return([][]opstateretrievar.OperatorStateRetrieverOperator{ - { - { - OperatorId: testOperator.operatorId, - Stake: big.NewInt(123), - }, - }, - }, nil) - mockAvsRegistryReader.EXPECT().GetOperatorFromId(gomock.Any(), testOperator.operatorId).Return(testOperator.operatorAddr, nil) - mockOperatorsInfoService.EXPECT().GetOperatorInfo(gomock.Any(), testOperator.operatorAddr).Return(testOperator.operatorInfo, true) - }, + name: "should return operatorsAvsState", queryQuorumNumbers: types.QuorumNums{1}, + operator: &testOperator1, queryBlockNum: 1, wantErr: nil, wantQuorumsAvsStateDict: map[types.QuorumNum]types.QuorumAvsState{ @@ -209,19 +184,15 @@ func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create mocks - mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) - mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) + mockAvsRegistryReader := fakes.NewFakeAVSRegistryReader(tt.operator, nil) + mockOperatorsInfoService := newFakeOperatorInfoService(tt.operator.OperatorInfo) - if tt.mocksInitializationFunc != nil { - tt.mocksInitializationFunc(mockAvsRegistryReader, mockOperatorsInfoService) - } // Create a new instance of the avsregistry service service := NewAvsRegistryServiceChainCaller(mockAvsRegistryReader, mockOperatorsInfoService, logger) // Call the GetOperatorPubkeys method with the test operator address aggG1PubkeyPerQuorum, gotErr := service.GetQuorumsAvsStateAtBlock(context.Background(), tt.queryQuorumNumbers, tt.queryBlockNum) - if tt.wantErr != gotErr { + if !errors.Is(gotErr, tt.wantErr) { t.Fatalf("GetOperatorsAvsState returned wrong error. Got: %v, want: %v.", gotErr, tt.wantErr) } if tt.wantErr == nil && !reflect.DeepEqual(tt.wantQuorumsAvsStateDict, aggG1PubkeyPerQuorum) { diff --git a/services/bls_aggregation/blsagg_test.go b/services/bls_aggregation/blsagg_test.go index 47211b37..96bfa951 100644 --- a/services/bls_aggregation/blsagg_test.go +++ b/services/bls_aggregation/blsagg_test.go @@ -4,6 +4,7 @@ import ( "context" "crypto/sha256" "encoding/json" + "github.com/ethereum/go-ethereum/ethclient" "log/slog" "math/big" "os" @@ -11,7 +12,6 @@ import ( "time" "github.com/Layr-Labs/eigensdk-go/chainio/clients" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/utils" "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/logging" @@ -77,8 +77,8 @@ func TestBlsAgg(t *testing.T) { blsSig := testOperator1.BlsKeypair.SignMessage(taskResponseDigest) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -125,8 +125,8 @@ func TestBlsAgg(t *testing.T) { require.Nil(t, err) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2, testOperator3}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -182,8 +182,8 @@ func TestBlsAgg(t *testing.T) { require.Nil(t, err) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -227,8 +227,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) // initialize 2 concurrent tasks task1Index := types.TaskIndex(1) @@ -309,8 +309,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err := blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -342,8 +342,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -384,8 +384,8 @@ func TestBlsAgg(t *testing.T) { blsSig := testOperator1.BlsKeypair.SignMessage(taskResponseDigest) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -420,8 +420,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -476,8 +476,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2, testOperator3}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -534,8 +534,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2, testOperator3}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -570,8 +570,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -608,8 +608,8 @@ func TestBlsAgg(t *testing.T) { blockNum := uint32(1) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -639,8 +639,8 @@ func TestBlsAgg(t *testing.T) { blsSig := testOperator1.BlsKeypair.SignMessage(taskResponseDigest) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.ProcessNewSignature(context.Background(), taskIndex, taskResponse, blsSig, testOperator1.OperatorId) require.Equal(t, TaskNotFoundErrorFn(taskIndex), err) @@ -665,8 +665,8 @@ func TestBlsAgg(t *testing.T) { quorumThresholdPercentages := []types.QuorumThresholdPercentage{100} fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err := blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -719,8 +719,8 @@ func TestBlsAgg(t *testing.T) { quorumThresholdPercentages := []types.QuorumThresholdPercentage{100} fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1, testOperator2}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err := blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -762,8 +762,8 @@ func TestBlsAgg(t *testing.T) { blsSig := testOperator1.BlsKeypair.SignMessage(taskResponseDigest) fakeAvsRegistryService := avsregistry.NewFakeAvsRegistryService(blockNum, []types.TestOperator{testOperator1}) - noopLogger := logging.NewNoopLogger() - blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, noopLogger) + logger := testutils.GetTestLogger() + blsAggServ := NewBlsAggregatorService(fakeAvsRegistryService, hashFunction, logger) err = blsAggServ.InitializeNewTask(taskIndex, blockNum, quorumNumbers, quorumThresholdPercentages, tasksTimeToExpiry) require.Nil(t, err) @@ -805,7 +805,7 @@ func TestIntegrationBlsAgg(t *testing.T) { operatorId := types.OperatorIdFromG1Pubkey(blsKeyPair.GetPubKeyG1()) // create avs clients to interact with contracts deployed on anvil - ethHttpClient, err := eth.NewClient(anvilHttpEndpoint) + ethHttpClient, err := ethclient.Dial(anvilHttpEndpoint) require.NoError(t, err) logger := logging.NewTextSLogger(os.Stdout, &logging.SLoggerOptions{Level: slog.LevelDebug}) avsClients, err := clients.BuildAll(clients.BuildAllConfig{ diff --git a/services/gen.go b/services/gen.go deleted file mode 100644 index 6d34428e..00000000 --- a/services/gen.go +++ /dev/null @@ -1,13 +0,0 @@ -package services - -//go:generate mockgen -destination=./mocks/operatorsinfo.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/operatorsinfo OperatorsInfoService -//go:generate mockgen -destination=./mocks/avsregistry.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/avsregistry AvsRegistryService - -// We generate it in ./mocks/blsagg/ instead of ./mocks like the others because otherwise we get a circular dependency -// avsregistry -> mocks -> avsregistry -// because avsregistry_chaincaller_test -> for blsApkRegistry mock -// and blsaggregation mock -> avsregistry interface -// TODO: are there better ways to organize these dependencies? Maybe by using ben johnson -// and having the avs registry interface be in the /avsregistry dir but the avsregistry_chaincaller -// and its test in a subdir? -//go:generate mockgen -destination=./mocks/blsagg/blsaggregation.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/bls_aggregation BlsAggregationService diff --git a/services/mocks/avsregistry.go b/services/mocks/avsregistry.go deleted file mode 100644 index 79e42c8e..00000000 --- a/services/mocks/avsregistry.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/services/avsregistry (interfaces: AvsRegistryService) -// -// Generated by this command: -// -// mockgen -destination=./mocks/avsregistry.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/avsregistry AvsRegistryService -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - contractOperatorStateRetriever "github.com/Layr-Labs/eigensdk-go/contracts/bindings/OperatorStateRetriever" - types "github.com/Layr-Labs/eigensdk-go/types" - bind "github.com/ethereum/go-ethereum/accounts/abi/bind" - gomock "go.uber.org/mock/gomock" -) - -// MockAvsRegistryService is a mock of AvsRegistryService interface. -type MockAvsRegistryService struct { - ctrl *gomock.Controller - recorder *MockAvsRegistryServiceMockRecorder -} - -// MockAvsRegistryServiceMockRecorder is the mock recorder for MockAvsRegistryService. -type MockAvsRegistryServiceMockRecorder struct { - mock *MockAvsRegistryService -} - -// NewMockAvsRegistryService creates a new mock instance. -func NewMockAvsRegistryService(ctrl *gomock.Controller) *MockAvsRegistryService { - mock := &MockAvsRegistryService{ctrl: ctrl} - mock.recorder = &MockAvsRegistryServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAvsRegistryService) EXPECT() *MockAvsRegistryServiceMockRecorder { - return m.recorder -} - -// GetCheckSignaturesIndices mocks base method. -func (m *MockAvsRegistryService) GetCheckSignaturesIndices(arg0 *bind.CallOpts, arg1 uint32, arg2 types.QuorumNums, arg3 []types.Bytes32) (contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCheckSignaturesIndices", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetCheckSignaturesIndices indicates an expected call of GetCheckSignaturesIndices. -func (mr *MockAvsRegistryServiceMockRecorder) GetCheckSignaturesIndices(arg0, arg1, arg2, arg3 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckSignaturesIndices", reflect.TypeOf((*MockAvsRegistryService)(nil).GetCheckSignaturesIndices), arg0, arg1, arg2, arg3) -} - -// GetOperatorsAvsStateAtBlock mocks base method. -func (m *MockAvsRegistryService) GetOperatorsAvsStateAtBlock(arg0 context.Context, arg1 types.QuorumNums, arg2 uint32) (map[types.Bytes32]types.OperatorAvsState, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorsAvsStateAtBlock", arg0, arg1, arg2) - ret0, _ := ret[0].(map[types.Bytes32]types.OperatorAvsState) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetOperatorsAvsStateAtBlock indicates an expected call of GetOperatorsAvsStateAtBlock. -func (mr *MockAvsRegistryServiceMockRecorder) GetOperatorsAvsStateAtBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsAvsStateAtBlock", reflect.TypeOf((*MockAvsRegistryService)(nil).GetOperatorsAvsStateAtBlock), arg0, arg1, arg2) -} - -// GetQuorumsAvsStateAtBlock mocks base method. -func (m *MockAvsRegistryService) GetQuorumsAvsStateAtBlock(arg0 context.Context, arg1 types.QuorumNums, arg2 uint32) (map[types.QuorumNum]types.QuorumAvsState, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQuorumsAvsStateAtBlock", arg0, arg1, arg2) - ret0, _ := ret[0].(map[types.QuorumNum]types.QuorumAvsState) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetQuorumsAvsStateAtBlock indicates an expected call of GetQuorumsAvsStateAtBlock. -func (mr *MockAvsRegistryServiceMockRecorder) GetQuorumsAvsStateAtBlock(arg0, arg1, arg2 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuorumsAvsStateAtBlock", reflect.TypeOf((*MockAvsRegistryService)(nil).GetQuorumsAvsStateAtBlock), arg0, arg1, arg2) -} diff --git a/services/mocks/blsagg/blsaggregation.go b/services/mocks/blsagg/blsaggregation.go deleted file mode 100644 index 418bf836..00000000 --- a/services/mocks/blsagg/blsaggregation.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/services/bls_aggregation (interfaces: BlsAggregationService) -// -// Generated by this command: -// -// mockgen -destination=./mocks/blsagg/blsaggregation.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/bls_aggregation BlsAggregationService -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - time "time" - - bls "github.com/Layr-Labs/eigensdk-go/crypto/bls" - blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation" - types "github.com/Layr-Labs/eigensdk-go/types" - gomock "go.uber.org/mock/gomock" -) - -// MockBlsAggregationService is a mock of BlsAggregationService interface. -type MockBlsAggregationService struct { - ctrl *gomock.Controller - recorder *MockBlsAggregationServiceMockRecorder -} - -// MockBlsAggregationServiceMockRecorder is the mock recorder for MockBlsAggregationService. -type MockBlsAggregationServiceMockRecorder struct { - mock *MockBlsAggregationService -} - -// NewMockBlsAggregationService creates a new mock instance. -func NewMockBlsAggregationService(ctrl *gomock.Controller) *MockBlsAggregationService { - mock := &MockBlsAggregationService{ctrl: ctrl} - mock.recorder = &MockBlsAggregationServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockBlsAggregationService) EXPECT() *MockBlsAggregationServiceMockRecorder { - return m.recorder -} - -// GetResponseChannel mocks base method. -func (m *MockBlsAggregationService) GetResponseChannel() <-chan blsagg.BlsAggregationServiceResponse { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetResponseChannel") - ret0, _ := ret[0].(<-chan blsagg.BlsAggregationServiceResponse) - return ret0 -} - -// GetResponseChannel indicates an expected call of GetResponseChannel. -func (mr *MockBlsAggregationServiceMockRecorder) GetResponseChannel() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseChannel", reflect.TypeOf((*MockBlsAggregationService)(nil).GetResponseChannel)) -} - -// InitializeNewTask mocks base method. -func (m *MockBlsAggregationService) InitializeNewTask(arg0, arg1 uint32, arg2 types.QuorumNums, arg3 types.QuorumThresholdPercentages, arg4 time.Duration) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InitializeNewTask", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(error) - return ret0 -} - -// InitializeNewTask indicates an expected call of InitializeNewTask. -func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTask(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeNewTask", reflect.TypeOf((*MockBlsAggregationService)(nil).InitializeNewTask), arg0, arg1, arg2, arg3, arg4) -} - -// ProcessNewSignature mocks base method. -func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 any, arg3 *bls.Signature, arg4 types.Bytes32) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ProcessNewSignature", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(error) - return ret0 -} - -// ProcessNewSignature indicates an expected call of ProcessNewSignature. -func (mr *MockBlsAggregationServiceMockRecorder) ProcessNewSignature(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessNewSignature", reflect.TypeOf((*MockBlsAggregationService)(nil).ProcessNewSignature), arg0, arg1, arg2, arg3, arg4) -} diff --git a/services/mocks/operatorsinfo.go b/services/mocks/operatorsinfo.go deleted file mode 100644 index 3f0b06d9..00000000 --- a/services/mocks/operatorsinfo.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Layr-Labs/eigensdk-go/services/operatorsinfo (interfaces: OperatorsInfoService) -// -// Generated by this command: -// -// mockgen -destination=./mocks/operatorsinfo.go -package=mocks github.com/Layr-Labs/eigensdk-go/services/operatorsinfo OperatorsInfoService -// - -// Package mocks is a generated GoMock package. -package mocks - -import ( - context "context" - reflect "reflect" - - types "github.com/Layr-Labs/eigensdk-go/types" - common "github.com/ethereum/go-ethereum/common" - gomock "go.uber.org/mock/gomock" -) - -// MockOperatorsInfoService is a mock of OperatorsInfoService interface. -type MockOperatorsInfoService struct { - ctrl *gomock.Controller - recorder *MockOperatorsInfoServiceMockRecorder -} - -// MockOperatorsInfoServiceMockRecorder is the mock recorder for MockOperatorsInfoService. -type MockOperatorsInfoServiceMockRecorder struct { - mock *MockOperatorsInfoService -} - -// NewMockOperatorsInfoService creates a new mock instance. -func NewMockOperatorsInfoService(ctrl *gomock.Controller) *MockOperatorsInfoService { - mock := &MockOperatorsInfoService{ctrl: ctrl} - mock.recorder = &MockOperatorsInfoServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockOperatorsInfoService) EXPECT() *MockOperatorsInfoServiceMockRecorder { - return m.recorder -} - -// GetOperatorInfo mocks base method. -func (m *MockOperatorsInfoService) GetOperatorInfo(arg0 context.Context, arg1 common.Address) (types.OperatorInfo, bool) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOperatorInfo", arg0, arg1) - ret0, _ := ret[0].(types.OperatorInfo) - ret1, _ := ret[1].(bool) - return ret0, ret1 -} - -// GetOperatorInfo indicates an expected call of GetOperatorInfo. -func (mr *MockOperatorsInfoServiceMockRecorder) GetOperatorInfo(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorInfo", reflect.TypeOf((*MockOperatorsInfoService)(nil).GetOperatorInfo), arg0, arg1) -} diff --git a/services/operatorsinfo/operatorsinfo_inmemory.go b/services/operatorsinfo/operatorsinfo_inmemory.go index 72254a63..9e289680 100644 --- a/services/operatorsinfo/operatorsinfo_inmemory.go +++ b/services/operatorsinfo/operatorsinfo_inmemory.go @@ -3,10 +3,12 @@ package operatorsinfo import ( "context" "errors" + blsapkreg "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" + regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" + "github.com/ethereum/go-ethereum/event" "math/big" "sync" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/types" @@ -16,6 +18,27 @@ import ( var defaultLogFilterQueryBlockRange = big.NewInt(10_000) +type avsRegistryReader interface { + QueryExistingRegisteredOperatorSockets( + ctx context.Context, + startBlock *big.Int, + stopBlock *big.Int, + blockRange *big.Int, + ) (map[types.OperatorId]types.Socket, error) + + QueryExistingRegisteredOperatorPubKeys( + ctx context.Context, + startBlock *big.Int, + stopBlock *big.Int, + blockRange *big.Int, + ) ([]types.OperatorAddr, []types.OperatorPubkeys, error) +} + +type avsRegistrySubscriber interface { + SubscribeToNewPubkeyRegistrations() (chan *blsapkreg.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) + SubscribeToOperatorSocketUpdates() (chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) +} + // OperatorsInfoServiceInMemory is a stateful goroutine (see https://gobyexample.com/stateful-goroutines) // implementation of OperatorsInfoService that listen for the NewPubkeyRegistration and OperatorSocketUpdate events using a websocket connection // to an eth client and stores the pubkeys/sockets in memory. Another possible implementation is using a mutex @@ -29,8 +52,8 @@ var defaultLogFilterQueryBlockRange = big.NewInt(10_000) // to be replicated and load-balanced, so that when it fails traffic can be switched to the other aggregator. type OperatorsInfoServiceInMemory struct { logFilterQueryBlockRange *big.Int - avsRegistrySubscriber avsregistry.Subscriber - avsRegistryReader avsregistry.Reader + avsRegistrySubscriber avsRegistrySubscriber + avsRegistryReader avsRegistryReader logger logging.Logger queryC chan<- query // queried via the queryC channel, so don't need mutex to access @@ -59,8 +82,8 @@ var _ OperatorsInfoService = (*OperatorsInfoServiceInMemory)(nil) // Using a separate initialize() function might lead to some users forgetting to call it and the service not behaving properly. func NewOperatorsInfoServiceInMemory( ctx context.Context, - avsRegistrySubscriber avsregistry.Subscriber, - avsRegistryReader avsregistry.Reader, + avsRegistrySubscriber avsRegistrySubscriber, + avsRegistryReader avsRegistryReader, logFilterQueryBlockRange *big.Int, logger logging.Logger, ) *OperatorsInfoServiceInMemory { diff --git a/services/operatorsinfo/operatorsinfo_inmemory_test.go b/services/operatorsinfo/operatorsinfo_inmemory_test.go index c0322223..200766a0 100644 --- a/services/operatorsinfo/operatorsinfo_inmemory_test.go +++ b/services/operatorsinfo/operatorsinfo_inmemory_test.go @@ -2,6 +2,8 @@ package operatorsinfo import ( "context" + + "github.com/ethereum/go-ethereum/event" "log/slog" "math/big" "os" @@ -9,23 +11,61 @@ import ( "testing" "time" - "github.com/Layr-Labs/eigensdk-go/chainio/mocks" + apkregistrybindings "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" + blsapkreg "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" + regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" "github.com/Layr-Labs/eigensdk-go/crypto/bls" + "github.com/Layr-Labs/eigensdk-go/internal/fakes" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/types" + "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" - "go.uber.org/mock/gomock" - - apkregistrybindings "github.com/Layr-Labs/eigensdk-go/contracts/bindings/BLSApkRegistry" - regcoordbindings "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" ) -type testOperator struct { - operatorAddr common.Address - operatorInfo types.OperatorInfo - contractG1Pubkey apkregistrybindings.BN254G1Point - contractG2Pubkey apkregistrybindings.BN254G2Point +type fakeAVSRegistrySubscriber struct { + pubkeyRegistrationEventC chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration + operatorSocketUpdateEventC chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate + eventSubscription *fakeEventSubscription +} + +func newFakeAVSRegistrySubscriber( + eventSubscription *fakeEventSubscription, + pubkeyRegistrationEventC chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration, + operatorSocketUpdateEventC chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate, +) *fakeAVSRegistrySubscriber { + return &fakeAVSRegistrySubscriber{ + pubkeyRegistrationEventC: pubkeyRegistrationEventC, + operatorSocketUpdateEventC: operatorSocketUpdateEventC, + eventSubscription: eventSubscription, + } +} + +func (f *fakeAVSRegistrySubscriber) SubscribeToNewPubkeyRegistrations() (chan *blsapkreg.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) { + return f.pubkeyRegistrationEventC, f.eventSubscription, nil +} + +func (f *fakeAVSRegistrySubscriber) SubscribeToOperatorSocketUpdates() (chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) { + return f.operatorSocketUpdateEventC, f.eventSubscription, nil +} + +type fakeEventSubscription struct { + errC chan error +} + +func newFakeEventSubscription( + errC chan error) *fakeEventSubscription { + return &fakeEventSubscription{ + errC: errC, + } +} + +func (f *fakeEventSubscription) Err() <-chan error { + return f.errC +} + +func (f *fakeEventSubscription) Unsubscribe() { + } func TestGetOperatorInfo(t *testing.T) { @@ -35,99 +75,73 @@ func TestGetOperatorInfo(t *testing.T) { G2Pubkey: bls.NewG2Point([2]*big.Int{big.NewInt(1), big.NewInt(1)}, [2]*big.Int{big.NewInt(1), big.NewInt(1)}), } contractG1Pubkey, contractG2Pubkey := operator1Pubkeys.ToContractPubkeys() - testOperator1 := testOperator{ - operatorAddr: common.HexToAddress("0x1"), - operatorInfo: types.OperatorInfo{ + testOperator1 := fakes.TestOperator{ + OperatorAddr: common.HexToAddress("0x1"), + OperatorInfo: types.OperatorInfo{ Pubkeys: operator1Pubkeys, Socket: "localhost:8080", }, - contractG1Pubkey: contractG1Pubkey, - contractG2Pubkey: contractG2Pubkey, + ContractG1Pubkey: contractG1Pubkey, + ContractG2Pubkey: contractG2Pubkey, + } + + pubkeyRegistrationEventC := make(chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration, 1) + pubkeyRegistrationEvent := &apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration{ + Operator: testOperator1.OperatorAddr, + PubkeyG1: testOperator1.ContractG1Pubkey, + PubkeyG2: testOperator1.ContractG2Pubkey, + Raw: gethtypes.Log{}, } + pubkeyRegistrationEventC <- pubkeyRegistrationEvent + operatorSocketUpdateEventC := make(chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate, 1) + operatorSocketUpdateEvent := ®coord.ContractRegistryCoordinatorOperatorSocketUpdate{ + OperatorId: types.OperatorIdFromG1Pubkey(testOperator1.OperatorInfo.Pubkeys.G1Pubkey), + Socket: string(testOperator1.OperatorInfo.Socket), + Raw: gethtypes.Log{}, + } + operatorSocketUpdateEventC <- operatorSocketUpdateEvent // Define tests var tests = []struct { - name string - mocksInitializationFunc func(*mocks.MockAVSSubscriber, *mocks.MockAVSReader, *mocks.MockSubscription) - queryOperatorAddr common.Address - wantOperatorFound bool - wantOperatorInfo types.OperatorInfo + name string + operator *fakes.TestOperator + pubkeyRegistrationEventC chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration + operatorSocketUpdateEventC chan *regcoord.ContractRegistryCoordinatorOperatorSocketUpdate + eventErrC chan error + queryOperatorAddr common.Address + wantOperatorFound bool + wantOperatorInfo types.OperatorInfo }{ { - name: "should return false if operator not found", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { - errC := make(chan error) - mockSubscription.EXPECT().Err().AnyTimes().Return(errC) - mockAvsRegistrySubscriber.EXPECT().SubscribeToNewPubkeyRegistrations().Return(nil, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorPubKeys(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange).Return(nil, nil, nil) - mockAvsRegistrySubscriber.EXPECT().SubscribeToOperatorSocketUpdates().Return(nil, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorSockets(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange).Return(nil, nil) - }, - queryOperatorAddr: testOperator1.operatorAddr, + name: "should return false if operator not found", + queryOperatorAddr: testOperator1.OperatorAddr, wantOperatorFound: false, wantOperatorInfo: types.OperatorInfo{}, }, { - name: "should return operator info found via query", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { - errC := make(chan error) - mockSubscription.EXPECT().Err().AnyTimes().Return(errC) - mockAvsRegistrySubscriber.EXPECT().SubscribeToNewPubkeyRegistrations().Return(nil, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorPubKeys(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange). - Return([]common.Address{testOperator1.operatorAddr}, []types.OperatorPubkeys{testOperator1.operatorInfo.Pubkeys}, nil) - mockAvsRegistrySubscriber.EXPECT().SubscribeToOperatorSocketUpdates().Return(nil, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorSockets(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange). - Return(map[types.OperatorId]types.Socket{ - types.OperatorIdFromG1Pubkey(testOperator1.operatorInfo.Pubkeys.G1Pubkey): testOperator1.operatorInfo.Socket, - }, nil) - }, - queryOperatorAddr: testOperator1.operatorAddr, + name: "should return operator info found via query", + operator: &testOperator1, + queryOperatorAddr: testOperator1.OperatorAddr, wantOperatorFound: true, - wantOperatorInfo: testOperator1.operatorInfo, + wantOperatorInfo: testOperator1.OperatorInfo, }, { - name: "should return operator info found via subscription", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { - errC := make(chan error) - pubkeyRegistrationEventC := make(chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration, 1) - pubkeyRegistrationEvent := &apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration{ - Operator: testOperator1.operatorAddr, - PubkeyG1: testOperator1.contractG1Pubkey, - PubkeyG2: testOperator1.contractG2Pubkey, - Raw: gethtypes.Log{}, - } - pubkeyRegistrationEventC <- pubkeyRegistrationEvent - operatorSocketUpdateEventC := make(chan *regcoordbindings.ContractRegistryCoordinatorOperatorSocketUpdate, 1) - operatorSocketUpdateEvent := ®coordbindings.ContractRegistryCoordinatorOperatorSocketUpdate{ - OperatorId: types.OperatorIdFromG1Pubkey(testOperator1.operatorInfo.Pubkeys.G1Pubkey), - Socket: string(testOperator1.operatorInfo.Socket), - Raw: gethtypes.Log{}, - } - operatorSocketUpdateEventC <- operatorSocketUpdateEvent - mockSubscription.EXPECT().Err().AnyTimes().Return(errC) - mockAvsRegistrySubscriber.EXPECT().SubscribeToNewPubkeyRegistrations().Return(pubkeyRegistrationEventC, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorPubKeys(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange). - Return([]common.Address{}, []types.OperatorPubkeys{}, nil) - mockAvsRegistrySubscriber.EXPECT().SubscribeToOperatorSocketUpdates().Return(operatorSocketUpdateEventC, mockSubscription, nil) - mockAvsReader.EXPECT().QueryExistingRegisteredOperatorSockets(gomock.Any(), nil, nil, defaultLogFilterQueryBlockRange).Return(nil, nil) - }, - queryOperatorAddr: testOperator1.operatorAddr, - wantOperatorFound: true, - wantOperatorInfo: testOperator1.operatorInfo, + name: "should return operator info found via subscription", + queryOperatorAddr: testOperator1.OperatorAddr, + pubkeyRegistrationEventC: pubkeyRegistrationEventC, + operatorSocketUpdateEventC: operatorSocketUpdateEventC, + wantOperatorFound: true, + wantOperatorInfo: testOperator1.OperatorInfo, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create mocks - mockCtrl := gomock.NewController(t) - mockAvsRegistrySubscriber := mocks.NewMockAVSSubscriber(mockCtrl) - mockAvsReader := mocks.NewMockAVSReader(mockCtrl) - mockSubscription := mocks.NewMockSubscription(mockCtrl) + mockSubscription := newFakeEventSubscription(tt.eventErrC) + mockAvsRegistrySubscriber := newFakeAVSRegistrySubscriber(mockSubscription, tt.pubkeyRegistrationEventC, tt.operatorSocketUpdateEventC) + mockAvsReader := fakes.NewFakeAVSRegistryReader(tt.operator, nil) - if tt.mocksInitializationFunc != nil { - tt.mocksInitializationFunc(mockAvsRegistrySubscriber, mockAvsReader, mockSubscription) - } // Create a new instance of the operatorpubkeys service service := NewOperatorsInfoServiceInMemory(context.Background(), mockAvsRegistrySubscriber, mockAvsReader, nil, logger) time.Sleep(2 * time.Second) // need to give it time to process the subscription events.. not sure if there's a better way to do this. diff --git a/signer/basic_signer.go b/signer/basic_signer.go index 778c214c..8ff440bb 100644 --- a/signer/basic_signer.go +++ b/signer/basic_signer.go @@ -6,7 +6,6 @@ import ( "fmt" "math/big" - sdkethclient "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/utils" @@ -20,9 +19,17 @@ import ( // exported as the default so that users can call NewBasicSigner with it if they don't know any better var FallbackGasTipCap = big.NewInt(15000000000) +type ethClient interface { + bind.ContractBackend + + ChainID(ctx context.Context) (*big.Int, error) + TransactionReceipt(ctx context.Context, txHash gethcommon.Hash) (*gethtypes.Receipt, error) +} + +// Deprecated: Use SignerV2 instead type BasicSigner struct { logger logging.Logger - ethClient sdkethclient.Client + ethClient ethClient privateKey *ecdsa.PrivateKey accountAddress gethcommon.Address contracts map[gethcommon.Address]*bind.BoundContract @@ -31,7 +38,7 @@ type BasicSigner struct { func NewBasicSigner( privateKey *ecdsa.PrivateKey, - ethClient sdkethclient.Client, + client ethClient, logger logging.Logger, fallbackGasTipCap *big.Int, ) (*BasicSigner, error) { @@ -43,7 +50,7 @@ func NewBasicSigner( return &BasicSigner{ logger: logger, - ethClient: ethClient, + ethClient: client, privateKey: privateKey, accountAddress: accountAddress, contracts: make(map[gethcommon.Address]*bind.BoundContract), diff --git a/signer/privatekey_signer.go b/signer/privatekey_signer.go index 4b84c330..73b8cdef 100644 --- a/signer/privatekey_signer.go +++ b/signer/privatekey_signer.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) +// Deprecated: Use SignerV2 instead type PrivateKeySigner struct { txOpts *bind.TransactOpts } diff --git a/signer/signer.go b/signer/signer.go index 708a2572..1c8573b3 100644 --- a/signer/signer.go +++ b/signer/signer.go @@ -15,6 +15,7 @@ import ( // // 2. A signer (remote signer) that we will send to an external rpc which takes care of signing and broadcasting the // signed transaction. They need to implement SendToExternal() function and leave GetSigner() unimplemented. +// Deprecated: Use SignerV2 instead type Signer interface { GetTxOpts() *bind.TransactOpts SendToExternal(ctx context.Context, tx *types.Transaction) (common.Hash, error) diff --git a/signerv2/kms_signer_test.go b/signerv2/kms_signer_test.go index ec2cdde0..b08d6990 100644 --- a/signerv2/kms_signer_test.go +++ b/signerv2/kms_signer_test.go @@ -8,18 +8,21 @@ import ( "testing" eigenkms "github.com/Layr-Labs/eigensdk-go/aws/kms" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" - "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/signerv2" "github.com/Layr-Labs/eigensdk-go/testutils" + "github.com/aws/aws-sdk-go-v2/service/kms/types" + "github.com/ethereum/go-ethereum/common" gtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" + "github.com/stretchr/testify/assert" + "github.com/testcontainers/testcontainers-go" ) @@ -94,8 +97,8 @@ func TestSendTransaction(t *testing.T) { err = rpcClient.CallContext(context.Background(), nil, "anvil_setBalance", keyAddr, 2_000_000_000_000_000_000) assert.Nil(t, err) - logger := &logging.NoopLogger{} - ethClient, err := eth.NewClient(anvilEndpoint) + logger := testutils.GetTestLogger() + ethClient, err := ethclient.Dial(anvilEndpoint) assert.Nil(t, err) chainID, err := ethClient.ChainID(context.Background()) assert.Nil(t, err) diff --git a/testutils/anvil.go b/testutils/anvil.go index f7fb6d20..c4da31ca 100644 --- a/testutils/anvil.go +++ b/testutils/anvil.go @@ -3,12 +3,12 @@ package testutils import ( "context" "fmt" + "github.com/ethereum/go-ethereum/ethclient" "log" "os/exec" "path/filepath" "runtime" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/testcontainers/testcontainers-go" @@ -64,7 +64,7 @@ type ContractAddresses struct { } func GetContractAddressesFromContractRegistry(ethHttpUrl string) (mockAvsContracts ContractAddresses) { - ethHttpClient, err := eth.NewClient(ethHttpUrl) + ethHttpClient, err := ethclient.Dial(ethHttpUrl) if err != nil { panic(err) } diff --git a/testutils/logger.go b/testutils/logger.go new file mode 100644 index 00000000..81df561e --- /dev/null +++ b/testutils/logger.go @@ -0,0 +1,17 @@ +package testutils + +import ( + "log/slog" + "os" + + "github.com/Layr-Labs/eigensdk-go/logging" +) + +func GetTestLogger() logging.Logger { + return logging.NewTextSLogger(os.Stdout, + &logging.SLoggerOptions{ + Level: slog.LevelDebug, + AddSource: true, + }, + ) +} diff --git a/types/operator_metadata_test.go b/types/operator_metadata_test.go index eb7e8059..c08cfcc8 100644 --- a/types/operator_metadata_test.go +++ b/types/operator_metadata_test.go @@ -18,7 +18,7 @@ func TestOperatorMetadata(t *testing.T) { name: "Valid metadata with twitter.com url", metadata: OperatorMetadata{ Name: "Ethereum Utopia", - Description: "Madhur's first operator is best in this world+&~#$—%’", + Description: "Madhur's first operator is best in this world+&~#$—%’“”", Logo: "https://goerli-operator-metadata.s3.amazonaws.com/eigenlayer.png", Twitter: "https://twitter.com/test", Website: "https://test.com", @@ -100,7 +100,7 @@ func TestOperatorMetadata(t *testing.T) { expectedError: utils.ErrInvalidImageMimeType, }, { - name: "Invalid metadata - name > 200 characters", + name: "Invalid metadata - name > 500 characters", metadata: OperatorMetadata{ Name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", Description: "test", @@ -108,10 +108,10 @@ func TestOperatorMetadata(t *testing.T) { Twitter: "https://twitter.com/test", Website: "https://test.com", }, - expectedError: utils.WrapError(ErrInvalidName, utils.ErrTextTooLong), + expectedError: utils.WrapError(ErrInvalidName, utils.ErrTextTooLong(utils.TextCharsLimit)), }, { - name: "Invalid metadata - description > 200 characters", + name: "Invalid metadata - description > 500 characters", metadata: OperatorMetadata{ Name: "test", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", @@ -119,7 +119,7 @@ func TestOperatorMetadata(t *testing.T) { Twitter: "https://twitter.com/test", Website: "https://test.com", }, - expectedError: utils.WrapError(ErrInvalidDescription, utils.ErrTextTooLong), + expectedError: utils.WrapError(ErrInvalidDescription, utils.ErrTextTooLong(utils.TextCharsLimit)), }, { name: "Invalid metadata - no logo", diff --git a/utils/errors.go b/utils/errors.go index 349cdd13..02a1d9ac 100644 --- a/utils/errors.go +++ b/utils/errors.go @@ -7,10 +7,12 @@ import ( ) var ( - ErrInvalidUrl = errors.New("invalid url") - ErrInvalidGithubRawUrl = errors.New("invalid github raw url") - ErrInvalidText = fmt.Errorf("invalid text format, doesn't conform to regex %s", TextRegex) - ErrTextTooLong = errors.New("text should be less than 500 characters") + ErrInvalidUrl = errors.New("invalid url") + ErrInvalidGithubRawUrl = errors.New("invalid github raw url") + ErrInvalidText = fmt.Errorf("invalid text format, doesn't conform to regex %s", TextRegex) + ErrTextTooLong = func(limit int) error { + return fmt.Errorf("text should be less than %d characters", limit) + } ErrEmptyText = errors.New("text is empty") ErrInvalidImageExtension = errors.New( "invalid image extension. only " + strings.Join(ImageExtensions, ",") + " is supported", diff --git a/utils/utils.go b/utils/utils.go index 6013eb8c..8fe8471a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -26,10 +26,12 @@ import ( const ( PngMimeType = "image/png" - TextRegex = `^[a-zA-Z0-9 +.,;:?!'’"\-_/()\[\]~&#$—%]+$` + TextRegex = `^[a-zA-Z0-9 +.,;:?!'’"“”\-_/()\[\]~&#$—%]+$` // Limit Http response to 1 MB httpResponseLimitBytes = 1 * 1024 * 1024 + + TextCharsLimit = 500 ) var ( @@ -240,8 +242,8 @@ func ValidateText(text string) error { return ErrEmptyText } - if len(text) > 500 { - return ErrTextTooLong + if len(text) > TextCharsLimit { + return ErrTextTooLong(TextCharsLimit) } // Regular expression to validate text