Skip to content
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

Chore/block signature message type #4787

Merged
merged 14 commits into from
May 14, 2024
Merged

Conversation

jferrant
Copy link
Collaborator

@jferrant jferrant commented May 13, 2024

Closes #4784

I made the process_event logic take a generic type which implements StacksMessageCodec to enable having different message types for v1 and v2 without borking up code in each respective path. I also implemented a helper function for creating a v1 signer. This same logic can easily be added for a v0 signer which wraps the super confusing looking RunningSigner struct.

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
hstove
hstove previously approved these changes May 13, 2024
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good to me. I mainly worry about needing to replace all the StacksMessageCodec + Clone lines

libsigner/src/events.rs Outdated Show resolved Hide resolved
libsigner/src/v0/messages.rs Outdated Show resolved Hide resolved
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
libsigner/src/events.rs Outdated Show resolved Hide resolved
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but please find a way to avoid using bare u8 constants for type prefixes in the message codecs. Thanks!

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant requested a review from jcnelson May 14, 2024 18:36
@jferrant jferrant changed the base branch from chore/signer-traits to develop May 14, 2024 18:37
@jferrant jferrant dismissed hstove’s stale review May 14, 2024 18:37

The base branch was changed.

@jferrant jferrant requested a review from hstove May 14, 2024 18:37
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
kantai
kantai previously approved these changes May 14, 2024
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some superficial comments.

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
kantai
kantai previously approved these changes May 14, 2024
jcnelson
jcnelson previously approved these changes May 14, 2024
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant dismissed stale reviews from jcnelson and kantai via 69fa6ef May 14, 2024 20:53
@jferrant jferrant requested review from jcnelson and kantai May 14, 2024 20:53
@jferrant jferrant enabled auto-merge May 14, 2024 21:18
@jferrant jferrant added this pull request to the merge queue May 14, 2024
@jferrant jferrant removed this pull request from the merge queue due to a manual request May 14, 2024
@jferrant jferrant added this pull request to the merge queue May 14, 2024
Merged via the queue into develop with commit 45cf912 May 14, 2024
92 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants