Commit 4e04768
committed
spectest: fix nil-deref generating the BeaconVoteDataNil valcheck vector
BeaconVoteDataNil builds a BeaconVote with nil Source/Target, then passed
*consensusData.Source / *consensusData.Target to NewSpecTest — which takes
phase0.Checkpoint by value — dereferencing the nil pointers and panicking
the whole vector generator (so no ssv spec-test vectors could be produced).
Pass zero checkpoints instead: a nil Source/Target SSZ-encodes to a zero
checkpoint, so that is the value the decoded vote carries, and the test
still asserts the source-not-less-than-target rejection.1 parent 05dea41 commit 4e04768
1 file changed
Lines changed: 6 additions & 3 deletions
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments