MCPcopy Create free account
hub / github.com/chain/Core / TestValidateBlock1Err

Function TestValidateBlock1Err

protocol/validation/block_test.go:21–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func TestValidateBlock1Err(t *testing.T) {
22 b1 := newInitialBlock(t)
23 transactionsRoot := bc.NewHash([32]byte{1})
24 b1.TransactionsRoot = &transactionsRoot // make b1 be invalid
25 err := ValidateBlock(b1, nil, b1.ID, dummyValidateTx)
26 if err == nil {
27 t.Errorf("ValidateBlock(%v, nil) = nil, want error", b1)
28 }
29}
30
31func TestValidateBlock2(t *testing.T) {
32 b1 := newInitialBlock(t)

Callers

nothing calls this directly

Calls 2

newInitialBlockFunction · 0.85
ValidateBlockFunction · 0.85

Tested by

no test coverage detected