testing

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FaultyMockPOWChain

type FaultyMockPOWChain struct {
	ChainFeed      *event.Feed
	HashesByHeight map[int][]byte
}

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

func (f *FaultyMockPOWChain) BlockNumberByTimestamp(_ context.Context, _ uint64) (*big.Int, error)

BlockNumberByTimestamp --

func (*FaultyMockPOWChain) BlockTimeByHeight

func (f *FaultyMockPOWChain) BlockTimeByHeight(_ context.Context, height *big.Int) (uint64, error)

BlockTimeByHeight --

func (*FaultyMockPOWChain) ChainStartDepositHashes

func (f *FaultyMockPOWChain) ChainStartDepositHashes() ([][]byte, error)

ChainStartDepositHashes --

func (*FaultyMockPOWChain) ChainStartDeposits

func (f *FaultyMockPOWChain) ChainStartDeposits() []*ethpb.Deposit

ChainStartDeposits --

func (*FaultyMockPOWChain) ChainStartEth1Data

func (f *FaultyMockPOWChain) ChainStartEth1Data() *ethpb.Eth1Data

ChainStartEth1Data --

func (*FaultyMockPOWChain) ChainStartFeed

func (f *FaultyMockPOWChain) ChainStartFeed() *event.Feed

ChainStartFeed --

func (*FaultyMockPOWChain) DepositRoot

func (f *FaultyMockPOWChain) DepositRoot() [32]byte

DepositRoot --

func (*FaultyMockPOWChain) DepositTrie

func (f *FaultyMockPOWChain) DepositTrie() *trieutil.MerkleTrie

DepositTrie --

func (*FaultyMockPOWChain) Eth2GenesisPowchainInfo

func (f *FaultyMockPOWChain) Eth2GenesisPowchainInfo() (uint64, *big.Int)

Eth2GenesisPowchainInfo --

func (*FaultyMockPOWChain) LatestBlockHeight

func (f *FaultyMockPOWChain) LatestBlockHeight() *big.Int

LatestBlockHeight --

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

func (m *POWChain) BlockExists(_ context.Context, hash common.Hash) (bool, *big.Int, error)

BlockExists --

func (*POWChain) BlockHashByHeight

func (m *POWChain) BlockHashByHeight(_ context.Context, height *big.Int) (common.Hash, error)

BlockHashByHeight --

func (*POWChain) BlockNumberByTimestamp

func (m *POWChain) BlockNumberByTimestamp(_ context.Context, time uint64) (*big.Int, error)

BlockNumberByTimestamp --

func (*POWChain) BlockTimeByHeight

func (m *POWChain) BlockTimeByHeight(_ context.Context, height *big.Int) (uint64, error)

BlockTimeByHeight --

func (*POWChain) ChainStartDepositHashes

func (m *POWChain) ChainStartDepositHashes() ([][]byte, error)

ChainStartDepositHashes --

func (*POWChain) ChainStartDeposits

func (m *POWChain) ChainStartDeposits() []*ethpb.Deposit

ChainStartDeposits --

func (*POWChain) ChainStartEth1Data

func (m *POWChain) ChainStartEth1Data() *ethpb.Eth1Data

ChainStartEth1Data --

func (*POWChain) ChainStartFeed

func (m *POWChain) ChainStartFeed() *event.Feed

ChainStartFeed --

func (*POWChain) DepositRoot

func (m *POWChain) DepositRoot() [32]byte

DepositRoot --

func (*POWChain) DepositTrie

func (m *POWChain) DepositTrie() *trieutil.MerkleTrie

DepositTrie --

func (*POWChain) Eth2GenesisPowchainInfo

func (m *POWChain) Eth2GenesisPowchainInfo() (uint64, *big.Int)

Eth2GenesisPowchainInfo --

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL