MCPcopy
hub / github.com/hyperledger/fabric / TestGoodBlockHeaderBytes

Function TestGoodBlockHeaderBytes

protoutil/blockutils_test.go:58–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestGoodBlockHeaderBytes(t *testing.T) {
59 goodBlockHeader := &cb.BlockHeader{
60 Number: 1,
61 PreviousHash: []byte("foo"),
62 DataHash: []byte("bar"),
63 }
64
65 _ = protoutil.BlockHeaderBytes(goodBlockHeader) // Should not panic
66
67 goodBlockHeaderMaxNumber := &cb.BlockHeader{
68 Number: math.MaxUint64,
69 PreviousHash: []byte("foo"),
70 DataHash: []byte("bar"),
71 }
72
73 _ = protoutil.BlockHeaderBytes(goodBlockHeaderMaxNumber) // Should not panic
74}
75
76func TestGetChannelIDFromBlockBytes(t *testing.T) {
77 gb, err := configtxtest.MakeGenesisBlock(testChannelID)

Callers

nothing calls this directly

Calls 1

BlockHeaderBytesFunction · 0.92

Tested by

no test coverage detected