js-multiformats
js-multiformats copied to clipboard
feat!: BlockEncoder optional promise for encode/decode
Enable the BlockEncoder to use promise API in encode/decode methods.
Why we need that:
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto
To enable the promise to encode/decode a breaking change to
createUnsafe is required.
The existing signature of createUnsafe can not pass a promise.
Therefore the tests need to change.
For me, measuring the blast radius of the change is impossible.
If the blast radius is too big then there is still the possibility to
create a new method createUnsafeAsync and throw an error
in the createUnsafe if the decode sends a promise.