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

fix: always include the pubkey in the inner bytes #56

Merged
merged 1 commit into from Feb 28, 2024

Conversation

Frando
Copy link
Contributor

@Frando Frando commented Feb 28, 2024

The inner bytes payload contained in a SignedPacket currently is different depending on how the SignedPacket was constructed. So the AsRef<[u8]> would returns a byte slice with the 32 byte pubkey at the beginning if the packet was created with SignedPacket::from_packet() and without the 32 byte pubkey if created with SignedPacket::from_relay_response().

This PR fixes this and also exposes as_bytes / from_bytes methods which are useful for persisting the full signed packet to a database or cache.

@Nuhvi
Copy link
Owner

Nuhvi commented Feb 28, 2024

Wow can't believe it took so long for this bug to be discovered, thanks @Frando.

@Nuhvi Nuhvi merged commit fc1ee62 into Nuhvi:main Feb 28, 2024
1 check failed
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

2 participants