Documentation
¶
Index ¶
- func FirstBlockHash(nodeManager common.NodeManager) (string, error)
- type BackendTestSuite
- func (s *BackendTestSuite) LightEthereumService() *les.LightEthereum
- func (s *BackendTestSuite) RestartTestNode()
- func (s *BackendTestSuite) SetupTest()
- func (s *BackendTestSuite) StartTestBackend(opts ...TestNodeOption)
- func (s *BackendTestSuite) StopTestBackend()
- func (s *BackendTestSuite) TearDownTest()
- func (s *BackendTestSuite) TxQueueManager() *transactions.Manager
- func (s *BackendTestSuite) WhisperService() *whisper.Whisper
- type NodeManagerTestSuite
- type TestNodeOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstBlockHash ¶
func FirstBlockHash(nodeManager common.NodeManager) (string, error)
FirstBlockHash validates Attach operation for the NodeManager.
Types ¶
type BackendTestSuite ¶
type BackendTestSuite struct {
suite.Suite
Backend *api.StatusBackend
}
BackendTestSuite is a test suite with api.StatusBackend initialized and a few utility methods to start and stop node or get various services.
func (*BackendTestSuite) LightEthereumService ¶
func (s *BackendTestSuite) LightEthereumService() *les.LightEthereum
LightEthereumService returns a reference to the LES service.
func (*BackendTestSuite) RestartTestNode ¶
func (s *BackendTestSuite) RestartTestNode()
RestartTestNode restarts a currently running node.
func (*BackendTestSuite) SetupTest ¶
func (s *BackendTestSuite) SetupTest()
SetupTest initializes Backend.
func (*BackendTestSuite) StartTestBackend ¶
func (s *BackendTestSuite) StartTestBackend(opts ...TestNodeOption)
StartTestBackend imports some keys and starts a node.
func (*BackendTestSuite) StopTestBackend ¶
func (s *BackendTestSuite) StopTestBackend()
StopTestBackend stops the node.
func (*BackendTestSuite) TearDownTest ¶
func (s *BackendTestSuite) TearDownTest()
TearDownTest cleans up the packages state.
func (*BackendTestSuite) TxQueueManager ¶
func (s *BackendTestSuite) TxQueueManager() *transactions.Manager
TxQueueManager returns a reference to the TxQueueManager.
func (*BackendTestSuite) WhisperService ¶
func (s *BackendTestSuite) WhisperService() *whisper.Whisper
WhisperService returns a reference to the Whisper service.
type NodeManagerTestSuite ¶
type NodeManagerTestSuite struct {
suite.Suite
NodeManager *node.NodeManager
}
NodeManagerTestSuite defines a test suit with NodeManager.
func (*NodeManagerTestSuite) StartTestNode ¶
func (s *NodeManagerTestSuite) StartTestNode(opts ...TestNodeOption)
StartTestNode initiazes a NodeManager instances with configuration retrieved from the test config.
func (*NodeManagerTestSuite) StopTestNode ¶
func (s *NodeManagerTestSuite) StopTestNode()
StopTestNode attempts to stop initialized NodeManager.
type TestNodeOption ¶
type TestNodeOption func(config *params.NodeConfig)
TestNodeOption is a callback passed to StartTestNode which alters its config.
func WithDataDir ¶
func WithDataDir(path string) TestNodeOption
WithDataDir returns TestNodeOption that allows to set another data dir.
func WithUpstream ¶
func WithUpstream(url string) TestNodeOption
WithUpstream returns TestNodeOption which enabled UpstreamConfig.