Open eskimor opened 1 month ago
We can use macro to wrapper newtype around a [Hash
] type. Not only for CandidateHash
, but also all defined hashtype. I'd like to work on this issue, but maybe that's a breaking change.
Stuff whose hash I could think of that might use a newtype (besides relay chain block)
But I'm not sure coz I don't see the entire picture. Anything you'd like to add? :) @eskimor
In general
Hash
is way to overloaded in the codebase,CandidateHash
was a glorious exception, being anewtype
aroundHash
, but due to thisDeRef
instance, it is still interchangeable, limiting the added type safety.We should:
CandidateHash
DeRef
instance.Hash
... although that change will be massive and probably overkill if we at least use newtypes for all other hashes.