(t *testing.T)
| 68 | } |
| 69 | |
| 70 | func TestHashTreeRootBlockHeader(t *testing.T) { |
| 71 | header := &types.BlockHeader{ |
| 72 | Slot: types.Slot(100), |
| 73 | ProposerIndex: types.ValidatorIndex(7), |
| 74 | ParentRoot: types.Root{1, 2, 3}, |
| 75 | StateRoot: types.Root{4, 5, 6}, |
| 76 | BodyRoot: types.Root{7, 8, 9}, |
| 77 | } |
| 78 | |
| 79 | root := HashTreeRootBlockHeader(header) |
| 80 | |
| 81 | if root == ZeroHash { |
| 82 | t.Error("expected non-zero root for block header") |
| 83 | } |
| 84 | |
| 85 | // Same header should produce same root |
| 86 | root2 := HashTreeRootBlockHeader(header) |
| 87 | if root != root2 { |
| 88 | t.Error("same header should produce same root") |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func TestHashTreeRootBlock(t *testing.T) { |
| 93 | block := &types.Block{ |
nothing calls this directly
no test coverage detected