Open Mirko-von-Leipzig opened 1 year ago
I think for json serde (rpc & gateway) we should consider a proc macro. Things we want to achieve:
I'm thinking we should be able to do annotations like:
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct L1ToL2Message {
#[pf_serde("Hex")]
pub from_address: EthereumAddress,
#[pf_serde("Vec<Decimal>")]
pub payload: Vec<L1ToL2MessagePayloadElem>,
#[pf_serde("Hex")]
pub selector: EntryPoint,
#[pf_serde("Hex")]
pub to_address: ContractAddress,
#[serde(default)]
#[pf_serde("Option<Hex>")]
pub nonce: Option<L1ToL2MessageNonce>,
}
Follow-up issue from #881.
We should aim at removing serde capabilities from
Felt
and its newtype wrappers inpathfinder_common
. Serde specifics should be handled by each component directly. This lets us decouple components more correctly.ToSql
andFromSql
however these should move to storage from common