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

[Bug] cannot derive Clone with sol macro from an ABI #617

Closed
erikreppel opened this issue May 1, 2024 · 5 comments · Fixed by #616
Closed

[Bug] cannot derive Clone with sol macro from an ABI #617

erikreppel opened this issue May 1, 2024 · 5 comments · Fixed by #616
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@erikreppel
Copy link
Contributor

Component

contract

What version of Alloy are you on?

alloy v0.1.0 (https://github.com/alloy-rs/alloy?rev=bbef8de#bbef8de3)

Operating System

macOS (Apple Silicon)

Describe the bug

(from discussion in telegram channel)
The sol macro using an abi file. The sol macro seems to automatically add #[derive(Clone)] to SolStructs and errors, but not to SolEvents, so trying to derive Clone when using an abi as input breaks because of conflicting implementations of Clone on SolStructs and errors.

telegram-cloud-document-1-5012973626165560801
telegram-cloud-document-1-5012973626165560803

telegram-cloud-document-1-5012973626165560806

telegram-cloud-document-1-5012973626165560806

@erikreppel erikreppel added the bug Something isn't working label May 1, 2024
@prestwich
Copy link
Member

prestwich commented May 1, 2024

quickest resolution would be to add a clone derive to the code in expand/event.rs

@prestwich prestwich added the good first issue Good for newcomers label May 1, 2024
@erikreppel
Copy link
Contributor Author

@prestwich not sure if its just this easy #616

@prestwich
Copy link
Member

yeah, that should do it. we need to release cc @DaniPopes

this is technically a breaking change but given the nature of the issue, basically no one would've actually hand implemented clone for these things

@prestwich
Copy link
Member

As follow up, we should probably make sure that we're completely consistent across all generated types

@DaniPopes DaniPopes transferred this issue from alloy-rs/alloy May 2, 2024
@DaniPopes
Copy link
Member

DaniPopes commented May 2, 2024

Fix released in 0.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants