Open bh2smith opened 1 year ago
So, after some digging, it turns out the Geth still returns both:
v and yParity.
Best solution I have for now is the following:
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SampleStruct {
pub v: YParity,
#[serde(skip_serializing_if = "Option::is_none")]
pub y_parity: Option<YParity>,
}
which parses both when json has v and when it has both.
Here is an example demonstrating the error (essentially any request for Hydrated Blocks)
The transaction Responses return both fields "yParity" and "v" (which are equivalent).
Observe the difference in data for this request:
when
NODE_URL
is ankr node vs quicknode or infura. Ankr returns a parsable response while the other two have "conflicting fields".This is likely due to this:
Is there some way to intercept serde to remove the conflicting fields in the response before parsing? It seems that this will need to be handled here since there are multiple nodes returning this data.
Brought up also in #9