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

adds feature-gated serde traits to TransactionMetadata #77

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

ebrightfield
Copy link
Contributor

Another simple one. Adds feature-flagged serde traits on TransactionMetadata and FailedTransactionMetadata. This will be useful for use cases involving sending the transaction results over the wire.

The requisite serde traits are already added on struct fields coming from solana-sdk. (De-)serializing Signature to/from string.

I didn't add serde to the default features of the crate, up to you.

@Aursen Aursen self-requested a review July 2, 2024 02:16
Copy link
Collaborator

@Aursen Aursen left a comment

Choose a reason for hiding this comment

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

Thank you for contributing, can you add it in changelog please?

Cargo.toml Outdated Show resolved Hide resolved
@Aursen Aursen self-requested a review July 2, 2024 08:26
@ebrightfield
Copy link
Contributor Author

Thank you for contributing, can you add it in changelog please?

My pleasure, done!

@Aursen Aursen merged commit 446167f into LiteSVM:master Jul 2, 2024
2 checks passed
@kevinheavey
Copy link
Collaborator

Hey @ebrightfield just saw this, what is serde_with_str.rs for?

@Aursen
Copy link
Collaborator

Aursen commented Jul 14, 2024

The module to serialize the signature as a string

@kevinheavey
Copy link
Collaborator

But Signature already derives Serialize, no?

#[repr(transparent)]
#[derive(
    Serialize, Deserialize, Clone, Copy, Default, Eq, PartialEq, Ord, PartialOrd, Hash, AbiExample,
)]
pub struct Signature(GenericArray<u8, U64>);

@Aursen
Copy link
Collaborator

Aursen commented Jul 14, 2024

Yeah but serialized as an array

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.

3 participants