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): #[sol] attributes and JSON ABI support #173

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

DaniPopes
Copy link
Member

Motivation

Closes #73
Closes #143
Closes #169

Solution

See sol! docs

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review

crates/dyn-abi/src/value.rs Outdated Show resolved Hide resolved
crates/sol-types/tests/ui/type.rs Outdated Show resolved Hide resolved
crates/sol-types/tests/doctests/json.rs Show resolved Hide resolved
crates/sol-types/Cargo.toml Outdated Show resolved Hide resolved
crates/sol-macro/src/lib.rs Show resolved Hide resolved
Self::#variant(inner) => ::core::result::Result::Ok(inner),
_ => ::core::result::Result::Err(self),
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot be const if destructor cannot be evaluated, so generating this function is useless when we are already generating TryFrom

@@ -91,8 +91,6 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, s: &ItemStruct) -> Result<TokenStream> {

#[allow(non_camel_case_types, non_snake_case, clippy::style)]
const _: () = {
use ::alloy_sol_types::private::*;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this failed with Multicall which has a Result struct because of import ambiguity, we don't need to do glob imports anymore

@DaniPopes
Copy link
Member Author

Will rewrite some logic after #181

@DaniPopes DaniPopes marked this pull request as draft July 9, 2023 20:54
@DaniPopes DaniPopes marked this pull request as ready for review July 10, 2023 02:02
@DaniPopes DaniPopes merged commit 32a2356 into main Jul 10, 2023
@DaniPopes DaniPopes deleted the dani/sol-attrs branch July 10, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants