Closed WietseWind closed 4 months ago
Ah yeah, Buffer is nodejs only, right, but its attempted usage will be a common occurrence ?
We can use Uint8Array, ArrayBuffer, DataView, etc instead of Buffer.
@tequdev We can, but we're trying to create an environment most devcs will be able to use, and using Buffer is much more straight forward for most than for us more experienced node/backend/frontend/bin/hex/... devs.
You'll see any dev use Buffer.from(something, someencoding).toString(someotherencoding)
before you'll see them use any of the alternatives.
I think when looking at these issues/findings/supported methods/classes/... we should always consider the third party dev workflow. We started this to offer a (more expensive in terms of computation and fees, but...) simple way for the average dev to get started with Hooks and some logic. Which means asking them to make the least amount of possible changes to their workflow / the least amount of Hook specific things learn about the JS environment.
So unless if something is too expensive / dangerous / tricky (eval, defining FNs, yielding, async) - in which case we shouldn't offer support, we should always consider the random-dev workflow over possible available workarounds.
Closing, Buffer not part of QuickJS
When doing anything with
Buffer
no Hook tx can't be executed anymore.Once this happened, no further HookSet without the
Buffer
... code works anymore.E.g.:
TX error:
Trace log: