LiteSVM / litesvm

Apache License 2.0
51 stars 10 forks source link

adds feature-gated serde traits to TransactionMetadata #77

Closed ebrightfield closed 2 weeks ago

ebrightfield commented 2 weeks ago

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.

ebrightfield commented 2 weeks ago

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

My pleasure, done!

kevinheavey commented 3 days ago

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

Aursen commented 3 days ago

The module to serialize the signature as a string

kevinheavey commented 3 days ago

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 commented 3 days ago

Yeah but serialized as an array