MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestAddMsg

Function TestAddMsg

consensus/vbft/msg_pool_test.go:26–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24import "testing"
25
26func TestAddMsg(t *testing.T) {
27 server := constructServer()
28 msgpool := newMsgPool(server, 1)
29 block, err := constructBlock()
30 if err != nil {
31 t.Errorf("constructBlock failed :%v", err)
32 return
33 }
34 blockproposalmsg := &blockProposalMsg{
35 Block: block,
36 }
37 h, _ := HashMsg(blockproposalmsg)
38 err = msgpool.AddMsg(blockproposalmsg, h)
39 t.Logf("TestAddMsg %v", err)
40}
41
42func TestHasMsg(t *testing.T) {
43 server := constructServer()

Callers

nothing calls this directly

Calls 6

constructServerFunction · 0.85
newMsgPoolFunction · 0.85
constructBlockFunction · 0.85
HashMsgFunction · 0.85
ErrorfMethod · 0.80
AddMsgMethod · 0.80

Tested by

no test coverage detected