Documentation ¶
Overview ¶
Package testing provides useful mocks for an eth1 powchain service as needed by unit tests for the beacon node.
Index ¶
- type FaultyMockPOWChain
- func (f *FaultyMockPOWChain) BlockExists(_ context.Context, hash common.Hash) (bool, *big.Int, error)
- func (f *FaultyMockPOWChain) BlockHashByHeight(_ context.Context, height *big.Int) (common.Hash, error)
- func (f *FaultyMockPOWChain) BlockNumberByTimestamp(_ context.Context, _ uint64) (*big.Int, error)
- func (f *FaultyMockPOWChain) BlockTimeByHeight(_ context.Context, height *big.Int) (uint64, error)
- func (f *FaultyMockPOWChain) ChainStartDeposits() []*ethpb.Deposit
- func (f *FaultyMockPOWChain) ChainStartEth1Data() *ethpb.Eth1Data
- func (f *FaultyMockPOWChain) ClearPreGenesisData()
- func (f *FaultyMockPOWChain) DepositRoot() [32]byte
- func (f *FaultyMockPOWChain) DepositTrie() *trieutil.SparseMerkleTrie
- func (f *FaultyMockPOWChain) Eth2GenesisPowchainInfo() (uint64, *big.Int)
- func (f *FaultyMockPOWChain) IsConnectedToETH1() bool
- func (f *FaultyMockPOWChain) LatestBlockHeight() *big.Int
- func (f *FaultyMockPOWChain) PreGenesisState() *beaconstate.BeaconState
- type POWChain
- func (m *POWChain) BlockExists(_ context.Context, hash common.Hash) (bool, *big.Int, error)
- func (m *POWChain) BlockHashByHeight(_ context.Context, height *big.Int) (common.Hash, error)
- func (m *POWChain) BlockNumberByTimestamp(_ context.Context, time uint64) (*big.Int, error)
- func (m *POWChain) BlockTimeByHeight(_ context.Context, height *big.Int) (uint64, error)
- func (m *POWChain) ChainStartDeposits() []*ethpb.Deposit
- func (m *POWChain) ChainStartEth1Data() *ethpb.Eth1Data
- func (m *POWChain) ClearPreGenesisData()
- func (m *POWChain) DepositRoot() [32]byte
- func (m *POWChain) DepositTrie() *trieutil.SparseMerkleTrie
- func (m *POWChain) Eth2GenesisPowchainInfo() (uint64, *big.Int)
- func (m *POWChain) IsConnectedToETH1() bool
- func (m *POWChain) PreGenesisState() *beaconstate.BeaconState
- type RPCClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FaultyMockPOWChain ¶
FaultyMockPOWChain defines an incorrectly functioning powchain service.
func (*FaultyMockPOWChain) BlockExists ¶
func (f *FaultyMockPOWChain) BlockExists(_ context.Context, hash common.Hash) (bool, *big.Int, error)
BlockExists --
func (*FaultyMockPOWChain) BlockHashByHeight ¶
func (f *FaultyMockPOWChain) BlockHashByHeight(_ context.Context, height *big.Int) (common.Hash, error)
BlockHashByHeight --
func (*FaultyMockPOWChain) BlockNumberByTimestamp ¶
BlockNumberByTimestamp --
func (*FaultyMockPOWChain) BlockTimeByHeight ¶
BlockTimeByHeight --
func (*FaultyMockPOWChain) ChainStartDeposits ¶
func (f *FaultyMockPOWChain) ChainStartDeposits() []*ethpb.Deposit
ChainStartDeposits --
func (*FaultyMockPOWChain) ChainStartEth1Data ¶
func (f *FaultyMockPOWChain) ChainStartEth1Data() *ethpb.Eth1Data
ChainStartEth1Data --
func (*FaultyMockPOWChain) ClearPreGenesisData ¶
func (f *FaultyMockPOWChain) ClearPreGenesisData()
ClearPreGenesisData --
func (*FaultyMockPOWChain) DepositRoot ¶
func (f *FaultyMockPOWChain) DepositRoot() [32]byte
DepositRoot --
func (*FaultyMockPOWChain) DepositTrie ¶
func (f *FaultyMockPOWChain) DepositTrie() *trieutil.SparseMerkleTrie
DepositTrie --
func (*FaultyMockPOWChain) Eth2GenesisPowchainInfo ¶
func (f *FaultyMockPOWChain) Eth2GenesisPowchainInfo() (uint64, *big.Int)
Eth2GenesisPowchainInfo --
func (*FaultyMockPOWChain) IsConnectedToETH1 ¶
func (f *FaultyMockPOWChain) IsConnectedToETH1() bool
IsConnectedToETH1 --
func (*FaultyMockPOWChain) LatestBlockHeight ¶
func (f *FaultyMockPOWChain) LatestBlockHeight() *big.Int
LatestBlockHeight --
func (*FaultyMockPOWChain) PreGenesisState ¶
func (f *FaultyMockPOWChain) PreGenesisState() *beaconstate.BeaconState
PreGenesisState --
type POWChain ¶
type POWChain struct { ChainFeed *event.Feed LatestBlockNumber *big.Int HashesByHeight map[int][]byte TimesByHeight map[int]uint64 BlockNumberByHeight map[uint64]*big.Int Eth1Data *ethpb.Eth1Data GenesisEth1Block *big.Int }
POWChain defines a properly functioning mock for the powchain service.
func (*POWChain) BlockExists ¶
BlockExists --
func (*POWChain) BlockHashByHeight ¶
BlockHashByHeight --
func (*POWChain) BlockNumberByTimestamp ¶
BlockNumberByTimestamp --
func (*POWChain) BlockTimeByHeight ¶
BlockTimeByHeight --
func (*POWChain) ChainStartDeposits ¶
ChainStartDeposits --
func (*POWChain) ChainStartEth1Data ¶
ChainStartEth1Data --
func (*POWChain) ClearPreGenesisData ¶
func (m *POWChain) ClearPreGenesisData()
ClearPreGenesisData --
func (*POWChain) DepositTrie ¶
func (m *POWChain) DepositTrie() *trieutil.SparseMerkleTrie
DepositTrie --
func (*POWChain) Eth2GenesisPowchainInfo ¶
Eth2GenesisPowchainInfo --
func (*POWChain) IsConnectedToETH1 ¶
IsConnectedToETH1 --
func (*POWChain) PreGenesisState ¶
func (m *POWChain) PreGenesisState() *beaconstate.BeaconState
PreGenesisState --