prysm-pulse/beacon-chain/rpc/testutil/mock_powchain_info_fetcher.go
Michael Neuder 9166f40a04
Eth1 connections (#10073)
* Adding Eth1 connections data message to service definition

* PoC implementation for ETH1 connections RPC

* naming revisions

* cleanup

* register powchain info fetcher

* regenerate protos

* gazelle Bazel

* fixing comments

Co-authored-by: Michael Neuder <michaelneuder@Michaels-MacBook-Pro.local>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-01-14 11:13:04 -05:00

38 lines
799 B
Go

package testutil
import (
"math/big"
)
// MockGenesisTimeFetcher is a fake implementation of the powchain.ChainInfoFetcher
type MockPOWChainInfoFetcher struct {
CurrEndpoint string
CurrError error
Endpoints []string
Errors []error
}
func (m *MockPOWChainInfoFetcher) Eth2GenesisPowchainInfo() (uint64, *big.Int) {
return uint64(0), &big.Int{}
}
func (m *MockPOWChainInfoFetcher) IsConnectedToETH1() bool {
return true
}
func (m *MockPOWChainInfoFetcher) CurrentETH1Endpoint() string {
return m.CurrEndpoint
}
func (m *MockPOWChainInfoFetcher) CurrentETH1ConnectionError() error {
return m.CurrError
}
func (m *MockPOWChainInfoFetcher) ETH1Endpoints() []string {
return m.Endpoints
}
func (m *MockPOWChainInfoFetcher) ETH1ConnectionErrors() []error {
return m.Errors
}