-
Notifications
You must be signed in to change notification settings - Fork 795
Chain has Serialization/Deserialization mismatch #2038
Comments
idk why strum serialize serializes as str as escaped string @DaniPopes mind taking a look? |
FYI Adding in a line for a serde alias lets the test pass.
Output:
|
that's just serde_json adding quotes for json and dbg! using Debug on a str escaping it What ethers version / ref are you using? @plotchy |
@DaniPopes |
Ok that's latest commit on master, but this has been a thing forever: I'm not sure how to fix this other than adding each and every kebab-case + alias to serde too, or a custom Deserialize impl with manual matching for snake_case + fallback to String::deserialize -> FromStr... |
Revisiting this from a long time ago. Noticing your comment in #2270
for my needs that fix worked great. Feel free to keep this open as an issue to track that if you'd like, but just wanted to let you know im satisfied with the patch |
Description
Using serde_json to save serializations of Chains within files, and later deserializing the files back into Chain objects.
Ran into an issue with the Chain::BinanceSmartChain deserialization failing. Below is a test showing the issue:
Here is the output of the test:
Looks like it wants to see "binance_smart_chain"
I imagine this occurs similarly for the other
#[strum(serialize = ...)]
Chains as well.link to Chain enum
The text was updated successfully, but these errors were encountered: