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.
The inner bytes payload contained in a
SignedPacket
currently is different depending on how theSignedPacket
was constructed. So theAsRef<[u8]>
would returns a byte slice with the 32 byte pubkey at the beginning if the packet was created withSignedPacket::from_packet()
and without the 32 byte pubkey if created withSignedPacket::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.