-
Notifications
You must be signed in to change notification settings - Fork 151
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
feature: abi-json crate #78
Conversation
failures unrelated, fixed in #79 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
What about
-json-abi
as the name? Matches-dyn-abi
-
As discussed, Item should be an interally tagged enum
#[serde(tag = "type")]
, this removes the need to manually implement deserialize.
I would also say it makes it collapsible into one file.
crates/abi-json/src/event.rs
Outdated
|
||
/// JSON representation of a complex event parameter. | ||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
pub struct ComplexEventParam { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not one struct, with components
as #[serde(default)]
/Option<Vec<_>>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back and forth on this. in the end, I decided to prevent users from ever accessing properties that don't exist. It is legitimately a different type too. E.g. all ComplexParam.type
fields will include "tuple"
while no SimpleParam.type
fields will
e93fed6
to
63c44e5
Compare
* refactor: derive Serde impls, use internally tagged enum * feat: abi-json no_std
Initial re-implementation of
ethabi
crate's JSON file format.