-
Notifications
You must be signed in to change notification settings - Fork 835
Closed
Description
Our bytesToHex helper returns '0x' when its input is undefined
. This seems odd and prone to errors. @jochem-brouwer and I have discussed this and we feel like this should be removed.
I have attempted removing it, but noticed that this led to many test errors in the monorepo that rely on undefined being handled in this way, so I thought it'd be better to leave this for a standalone PR.
export const bytesToHex = (bytes: Uint8Array): PrefixedHexString => {
if (bytes === undefined || bytes.length === 0) return '0x'
const unprefixedHex = bytesToUnprefixedHex(bytes)
return `0x${unprefixedHex}`
}
(Src:
if (bytes === undefined || bytes.length === 0) return '0x' |