Commit 4f5cc382 authored by Will Cory's avatar Will Cory

hexlify

parent 8c7d43f2
......@@ -39,4 +39,3 @@ describe(readAttestation.name, () => {
)
})
})
import { Address } from '@wagmi/core'
import { BigNumber } from 'ethers'
import { isAddress, isHexString, toUtf8Bytes } from 'ethers/lib/utils.js'
import {
hexlify,
isAddress,
isHexString,
toUtf8Bytes,
} from 'ethers/lib/utils.js'
import { WagmiBytes } from '../types/WagmiBytes'
......@@ -24,7 +29,7 @@ export const stringifyAttestationBytes = (
return bytes as WagmiBytes
}
if (typeof bytes === 'string') {
return BigNumber.from(toUtf8Bytes(bytes)).toHexString() as WagmiBytes
return hexlify(toUtf8Bytes(bytes)) as WagmiBytes
}
throw new Error(`unrecognized bytes type ${bytes satisfies never}`)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment