-
Notifications
You must be signed in to change notification settings - Fork 121
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
universe: RPC fixes #328
universe: RPC fixes #328
Conversation
From offline discussion: A better approach would be accepting both 33 and 32 byte script keys when possible. In the context of universes, we only store script keys as 32 bytes, but a user may provide the same key in both formats as other CLI commands will show asset script keys in 33 byte form. Will update this PR to add handling for both script key sizes. |
d46b466
to
4a6c32c
Compare
@jharveyb, remember to re-request review from reviewers when ready |
5fb7f89
to
9597bc0
Compare
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.
Nice work! 🍰
We have the same problem with group keys, since they are shown as 33-byte on the CLI in the outpoint of |
Discussed offline with @guggero to clear up some confusion:
Given that these keys will always have even parity, I think for this PR, we can just check the user-provided key for the even parity byte and then remove it / truncate the key before passing it along further. |
9597bc0
to
61d9108
Compare
61d9108
to
6576c28
Compare
In this commit, we update RPCs that accept script keys as an argument to accept both 32 and 33 byte keys. Since we display both formats in parts of the CLI, we also want to accept both formats. We also refactor outpoint unmarshalling.
6576c28
to
8c49fcb
Compare
Switched to key truncation + tested as working locally with an odd-parity group key. |
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.
Nice, LGTM 🎉
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.
Nice work 👍
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 🐲
Display 33-byte script keys instead of 32 bytes. We should audit the current structs are parsing to make it internally consistent, so that copy & paste works on the CLI.