Rather than block hashes (represented by the fields .sha256 and
.hash) being stateful, simply compute them on-the-fly. This ensures
that the correct values are always returned and takes the burden of
rehashing from test writers, making the code shorter overall. In a
first step, the fields are kept at the same name with @property
functions as drop-in replacements, for a minimal diff. In later commits,
the names are changed to be more descriptive and indicating the return
type of the block hash.
This is a partial backport of core#32868
https://github.com/bitcoin/bitcoin/pull/32868/commits/0716382c20a6f9297f5bceb88120905fb4857c02
Depends on D18736