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

Function testGetBlocks

client/queueprotocol_test.go:539–552  ·  view source on GitHub ↗
(t *testing.T, api client.QueueProtocolAPI)

Source from the content-addressed store, hash-verified

537}
538
539func testGetBlocks(t *testing.T, api client.QueueProtocolAPI) {
540 _, err := api.GetBlocks(&types.ReqBlocks{})
541 if err != nil {
542 t.Error("Call GetBlocks Failed.", err)
543 }
544 _, err = api.GetBlocks(nil)
545 if err == nil {
546 t.Error("GetBlocks(nil) need return error.")
547 }
548 _, err = api.GetBlocks(&types.ReqBlocks{Start: 1})
549 if err == nil {
550 t.Error("GetBlocks(&types.ReqBlocks{Start:1}) need return error.")
551 }
552}
553
554func testGetLastBlockSequence(t *testing.T, api client.QueueProtocolAPI) {
555 res, err := api.GetLastBlockSequence()

Callers 1

TestQueueProtocolFunction · 0.85

Calls 2

GetBlocksMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected