Skip to content
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

feat(sol-macro): add json-abi item generation #422

Merged
merged 10 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/sol-macro/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub struct SolAttrs {
pub all_derives: Option<bool>,
pub extra_methods: Option<bool>,
pub docs: Option<bool>,
pub abi: Option<bool>,

// TODO: Implement
pub rename: Option<LitStr>,
Expand Down Expand Up @@ -138,6 +139,7 @@ impl SolAttrs {
all_derives => bool()?,
extra_methods => bool()?,
docs => bool()?,
abi => bool()?,

rename => lit()?,
rename_all => CasingStyle::from_lit(&lit()?)?,
Expand Down Expand Up @@ -297,6 +299,10 @@ mod tests {
#[sol(docs)] => Ok(sol_attrs! { docs: true }),
#[sol(docs = true)] => Ok(sol_attrs! { docs: true }),
#[sol(docs = false)] => Ok(sol_attrs! { docs: false }),

#[sol(abi)] => Ok(sol_attrs! { abi: true }),
#[sol(abi = true)] => Ok(sol_attrs! { abi: true }),
#[sol(abi = false)] => Ok(sol_attrs! { abi: false }),
}

rename {
Expand Down
Loading