-
Notifications
You must be signed in to change notification settings - Fork 32
feat(core): CKB_TX_MESSAGE_ALL #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Hanssen0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4f1083c to
1d5d04d
Compare
described in: nervosnetwork/rfcs#446