Closed Isaac-DeFrain closed 1 month ago
We should strongly type all the things
There are some performance considerations around this. Currently we're passing around &str and refactoring to TxnHash(pub String) would result in many more memory allocations on the heap. There probably are some ways around this using Cow, but I think it is a little beyond me at this moment.
Cow isn't necessary if you aren't mutating a shared resource. Just pass in the &TxnHash. This feels like prematurely optimization. Even better would be to use the txh hashes binary representation as the value rather than it's string-ified representation.
We should use
pub struct TxnHash(pub String)
overString