MCPcopy Create free account
hub / github.com/33cn/chain33 / TestQueueProtocol_GetFinalizedBlock

Function TestQueueProtocol_GetFinalizedBlock

client/queueprotocol_test.go:1351–1370  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1349}
1350
1351func TestQueueProtocol_GetFinalizedBlock(t *testing.T) {
1352
1353 q := queue.New("test")
1354
1355 cli := q.Client()
1356 api, err := client.New(cli, nil)
1357 require.Nil(t, err)
1358 defer cli.Close()
1359 go func() {
1360
1361 cli.Sub("blockchain")
1362 for msg := range cli.Recv() {
1363 msg.Reply(cli.NewMessage("", 0, &types.SnowChoice{Height: 1}))
1364 }
1365 }()
1366
1367 sc, err := api.GetFinalizedBlock()
1368 require.Nil(t, err)
1369 require.Equal(t, 1, int(sc.GetHeight()))
1370}

Callers

nothing calls this directly

Calls 10

NewFunction · 0.92
NewFunction · 0.92
ClientMethod · 0.65
CloseMethod · 0.65
SubMethod · 0.65
RecvMethod · 0.65
ReplyMethod · 0.65
NewMessageMethod · 0.65
GetFinalizedBlockMethod · 0.65
GetHeightMethod · 0.45

Tested by

no test coverage detected