Documentation ¶
Index ¶
- func NewInMemObscuroClient(hostContainer *container.HostContainer) rpc.Client
- type MockP2P
- func (n *MockP2P) BroadcastBatches(batches []*common.ExtBatch) error
- func (n *MockP2P) HealthStatus() host.HealthStatus
- func (n *MockP2P) ReceiveBatchRequest(requestID string, fromSeqNo *big.Int)
- func (n *MockP2P) ReceiveBatches(batches []*common.ExtBatch, isLive bool)
- func (n *MockP2P) ReceiveTransaction(tx common.EncryptedTx)
- func (n *MockP2P) RefreshPeerList()
- func (n *MockP2P) RequestBatchesFromSequencer(fromSeqNo *big.Int) error
- func (n *MockP2P) RespondToBatchRequest(requesterID string, batches []*common.ExtBatch) error
- func (n *MockP2P) SendTxToSequencer(tx common.EncryptedTx) error
- func (n *MockP2P) Start() error
- func (n *MockP2P) Stop() error
- func (n *MockP2P) SubscribeForBatchRequests(handler host.P2PBatchRequestHandler) func()
- func (n *MockP2P) SubscribeForBatches(handler host.P2PBatchHandler) func()
- func (n *MockP2P) SubscribeForTx(handler host.P2PTxHandler) func()
- func (n *MockP2P) UpdatePeerList([]string)
- type MockP2PNetwork
- func (m *MockP2PNetwork) BroadcastBatch(fromNodeID string, batches []*common.ExtBatch)
- func (m *MockP2PNetwork) NewNode(id int) host.P2PHostService
- func (m *MockP2PNetwork) RequestBatchesFromSequencer(id string, fromSeqNo *big.Int)
- func (m *MockP2PNetwork) RespondToBatchRequest(requesterID string, batches []*common.ExtBatch)
- func (m *MockP2PNetwork) SendTransactionToSequencer(tx common.EncryptedTx)
- type MockP2PNetworkIntf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInMemObscuroClient ¶
func NewInMemObscuroClient(hostContainer *container.HostContainer) rpc.Client
Types ¶
type MockP2P ¶
type MockP2P struct {
// contains filtered or unexported fields
}
MockP2P - models the p2p service of a host, but instead of sending messages over tcp it uses the `MockP2PNetwork` to distribute messages
func NewMockP2P ¶
func NewMockP2P(network *MockP2PNetwork, id string, isIncomingP2PDisabled bool) *MockP2P
NewMockP2P returns an instance of a configured L2 Network (no nodes)
func (*MockP2P) BroadcastBatches ¶
func (*MockP2P) HealthStatus ¶
func (n *MockP2P) HealthStatus() host.HealthStatus
func (*MockP2P) ReceiveBatchRequest ¶
ReceiveBatchRequest is a mock method that simulates receiving a batch request from a peer and then forwarding to all subscribers
func (*MockP2P) ReceiveBatches ¶
ReceiveBatches is a mock method that simulates receiving a batch from a peer and then forwarding to all subscribers
func (*MockP2P) ReceiveTransaction ¶
func (n *MockP2P) ReceiveTransaction(tx common.EncryptedTx)
ReceiveTransaction is a mock method that simulates receiving a batch from a peer and then forwarding to all subscribers
func (*MockP2P) RefreshPeerList ¶
func (n *MockP2P) RefreshPeerList()
func (*MockP2P) RequestBatchesFromSequencer ¶
func (*MockP2P) RespondToBatchRequest ¶
func (*MockP2P) SendTxToSequencer ¶
func (n *MockP2P) SendTxToSequencer(tx common.EncryptedTx) error
func (*MockP2P) SubscribeForBatchRequests ¶
func (n *MockP2P) SubscribeForBatchRequests(handler host.P2PBatchRequestHandler) func()
func (*MockP2P) SubscribeForBatches ¶
func (n *MockP2P) SubscribeForBatches(handler host.P2PBatchHandler) func()
func (*MockP2P) SubscribeForTx ¶
func (n *MockP2P) SubscribeForTx(handler host.P2PTxHandler) func()
func (*MockP2P) UpdatePeerList ¶
type MockP2PNetwork ¶
type MockP2PNetwork struct {
// contains filtered or unexported fields
}
func (*MockP2PNetwork) BroadcastBatch ¶
func (m *MockP2PNetwork) BroadcastBatch(fromNodeID string, batches []*common.ExtBatch)
func (*MockP2PNetwork) NewNode ¶
func (m *MockP2PNetwork) NewNode(id int) host.P2PHostService
func (*MockP2PNetwork) RequestBatchesFromSequencer ¶
func (m *MockP2PNetwork) RequestBatchesFromSequencer(id string, fromSeqNo *big.Int)
func (*MockP2PNetwork) RespondToBatchRequest ¶
func (m *MockP2PNetwork) RespondToBatchRequest(requesterID string, batches []*common.ExtBatch)
func (*MockP2PNetwork) SendTransactionToSequencer ¶
func (m *MockP2PNetwork) SendTransactionToSequencer(tx common.EncryptedTx)
type MockP2PNetworkIntf ¶
type MockP2PNetworkIntf interface {
NewNode(id int) host.P2PHostService
}
func NewMockP2PNetwork ¶
Click to show internal directories.
Click to hide internal directories.