Conversation
🦋 Changeset detectedLatest commit: 396dbb4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
integration tests: xxuejie/ckb-tx-message-all-test-vector-utils#2 |
Hanssen0
left a comment
There was a problem hiding this comment.
This PR provides a good start for CCC to support MESSAGE_ALL signing in the future. However, some API designs need to be discussed more before merging.
Hanssen0
left a comment
There was a problem hiding this comment.
I noticed that the logic of hashBytes[Opt]ToHasher can actually be replaced by mol.Bytes[Opt]. I suggest using mol.Bytes[Opt].encode directly to save some code here.
By the way, please add a changeset using pnpm changeset in the project directory.
Anyway, I think this code is good enough to be merged. Thank you so much for the contribution. Should we merge it directly, or wait until the proposal is confirmed?
According to the RFC:
The hashBytesToHasher function follows the RFC mentioned above(Although It uses the same encoding as Molecule bytes, it doesn't mention molecule encoding). I believe this version is much cleaner and easier to understand. The hashBytesOptToHasher function adds an extra header, based on BytesOpt encoding. When BytesOpt is none, it results in zero bytes, so we include an extra header to differentiate it. Here, I've added a molecule encode, according to the RFC. |
4f1083c to
1d5d04d
Compare
described in: nervosnetwork/rfcs#446