Hash, BlockId and Fragment are all internally the same Rust type (Hash) and they each provide a way of calculating the hash from a byte array.
However, this function was called from_bytes which is very misleading because from_bytes everywhere else in the codebase means to simply interpret the bytes as the type.
To dis-ambiguate, I renamed the from_bytes to calculate and added a new from_bytes function that interprets the bytes as the type as you would expect
Hash
,BlockId
andFragment
are all internally the same Rust type (Hash
) and they each provide a way of calculating the hash from a byte array.However, this function was called
from_bytes
which is very misleading becausefrom_bytes
everywhere else in the codebase means to simply interpret the bytes as the type.To dis-ambiguate, I renamed the
from_bytes
tocalculate
and added a newfrom_bytes
function that interprets the bytes as the type as you would expect