2022-01-14 16:13:04 +00:00
|
|
|
package testutil
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
)
|
|
|
|
|
2022-05-19 04:38:04 +00:00
|
|
|
// MockPOWChainInfoFetcher is a fake implementation of the powchain.ChainInfoFetcher
|
2022-01-14 16:13:04 +00:00
|
|
|
type MockPOWChainInfoFetcher struct {
|
|
|
|
CurrEndpoint string
|
|
|
|
CurrError error
|
|
|
|
Endpoints []string
|
|
|
|
Errors []error
|
|
|
|
}
|
|
|
|
|
2022-05-19 04:38:04 +00:00
|
|
|
func (*MockPOWChainInfoFetcher) Eth2GenesisPowchainInfo() (uint64, *big.Int) {
|
2022-01-14 16:13:04 +00:00
|
|
|
return uint64(0), &big.Int{}
|
|
|
|
}
|
|
|
|
|
2022-05-19 04:38:04 +00:00
|
|
|
func (*MockPOWChainInfoFetcher) IsConnectedToETH1() bool {
|
2022-01-14 16:13:04 +00:00
|
|
|
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
|
|
|
|
}
|