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

Function TestValidateBlock2Err

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

Source from the content-addressed store, hash-verified

38}
39
40func TestValidateBlock2Err(t *testing.T) {
41 b1 := newInitialBlock(t)
42 b2 := generate(t, b1)
43 transactionsRoot := bc.NewHash([32]byte{1})
44 b2.TransactionsRoot = &transactionsRoot // make b2 be invalid
45 err := ValidateBlock(b2, b1, b2.ID, dummyValidateTx)
46 if err == nil {
47 t.Errorf("ValidateBlock(%v, %v) = nil, want error", b2, b1)
48 }
49}
50
51func TestValidateBlockSig2(t *testing.T) {
52 b1 := newInitialBlock(t)

Callers

nothing calls this directly

Calls 3

newInitialBlockFunction · 0.85
generateFunction · 0.85
ValidateBlockFunction · 0.85

Tested by

no test coverage detected