Commit 0a427c2
test(rpc): cover the block-tree derived record, which had no test at all
A mutation audit of the header change found that dropping the header from
`Context::header_record` entirely failed no test. That path builds a BlockRecord
from the block tree rather than from applied-block bytes, and this change gave
it a `serialize(&node.header).try_into().ok()` whose failure mode is a silently
absent header -- where the old String field would at least have carried
something. It was the one part of the change nothing exercised.
`tree_derived_record_carries_the_header` seeds a tree node, resolves the record
through `record_for_hash` without pushing anything into `blocks`, and asserts
both the raw bytes and the rendered hex match the header the tree holds.
The rest of the change is well covered, and the audit says so rather than
assuming it: neutering `header_from_block_bytes` fails five tests, three of them
pre-existing `getblock` tests, and emptying `header_hex()` fails the round-trip
test. The new test now fails under the mutation that found the gap.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent a53523d commit 0a427c2
1 file changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1049 | 1094 | | |
1050 | 1095 | | |
1051 | 1096 | | |
| |||
0 commit comments