MCPcopy Index your code
hub / github.com/DOSNetwork/core / receiveEvent

Function receiveEvent

p2p/server_test.go:14–23  ·  view source on GitHub ↗
(pListener P2PInterface, t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func receiveEvent(pListener P2PInterface, t *testing.T) {
15 events, _ := pListener.SubscribeEvent(1, Ping{})
16 for msg := range events {
17 r, ok := msg.Msg.Message.(*Ping)
18 if !ok {
19 t.Errorf("Not ok")
20 }
21 pListener.Reply(msg.Sender, msg.RequestNonce, proto.Message(&Pong{Count: r.Count + 10}))
22 }
23}
24
25func TestServer(t *testing.T) {
26 listener := []byte("9")

Callers 1

TestServerFunction · 0.85

Calls 2

SubscribeEventMethod · 0.65
ReplyMethod · 0.65

Tested by

no test coverage detected