fakenode

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(method string, args ...interface{}) call

func FakePeers

func FakePeers(num int) []ethnode.PeerInfo

Types

type Calls

type Calls []call

type FakeNode

type FakeNode struct {
	NodeKind        ethnode.NodeKind
	NodeID          string
	Calls           Calls
	FakePeers       []ethnode.PeerInfo
	FakeBlockNumber uint64
}

FakeNode is an implementation of ethnode.EthNode that no-ops for everything.

func Node

func Node(nodeID string) *FakeNode

func (*FakeNode) AddTrustedPeer

func (n *FakeNode) AddTrustedPeer(ctx context.Context, nodeID string) error

func (*FakeNode) BlockNumber added in v0.2.2

func (n *FakeNode) BlockNumber(ctx context.Context) (uint64, error)

func (*FakeNode) ConnectPeer

func (n *FakeNode) ConnectPeer(ctx context.Context, nodeURI string) error

func (*FakeNode) ContractBackend added in v0.2.3

func (n *FakeNode) ContractBackend() bind.ContractBackend

func (*FakeNode) DisconnectPeer

func (n *FakeNode) DisconnectPeer(ctx context.Context, nodeID string) error

func (*FakeNode) Enode

func (n *FakeNode) Enode(ctx context.Context) (string, error)

func (*FakeNode) Kind

func (n *FakeNode) Kind() ethnode.NodeKind

func (*FakeNode) Peers

func (n *FakeNode) Peers(ctx context.Context) ([]ethnode.PeerInfo, error)

func (*FakeNode) RemoveTrustedPeer

func (n *FakeNode) RemoveTrustedPeer(ctx context.Context, nodeID string) error

Jump to

Keyboard shortcuts

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