test

package
v0.31.6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoEngine

type EchoEngine struct {
	sync.RWMutex

	mockcomponent.Component
	// contains filtered or unexported fields
}

EchoEngine is a simple engine that is used for testing the correctness of driving the engines with libp2p, in addition to receiving and storing incoming messages it also echos them back

func NewEchoEngine

func NewEchoEngine(t *testing.T, net network.Network, cap int, channel channels.Channel, echo bool, send testutils.ConduitSendWrapperFunc) *EchoEngine

func (*EchoEngine) Process

func (te *EchoEngine) Process(channel channels.Channel, originID flow.Identifier, event interface{}) error

Process receives an originID and an event and casts them into the corresponding fields of the EchoEngine. It then flags the received channel on reception of an event. It also sends back an echo of the message to the origin ID

func (*EchoEngine) ProcessLocal

func (te *EchoEngine) ProcessLocal(event interface{}) error

ProcessLocal is implemented for a valid type assertion to Engine any call to it fails the test

func (*EchoEngine) Submit

func (te *EchoEngine) Submit(channel channels.Channel, originID flow.Identifier, event interface{})

Submit is implemented for a valid type assertion to Engine any call to it fails the test

func (*EchoEngine) SubmitLocal

func (te *EchoEngine) SubmitLocal(event interface{})

SubmitLocal is implemented for a valid type assertion to Engine any call to it fails the test

Jump to

Keyboard shortcuts

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