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

Support optional fields in EventFilter typespecs #144

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

NduatiK
Copy link
Contributor

@NduatiK NduatiK commented Oct 12, 2024

First off, thanks for the library alisinabh.


The current typespec generator emits a dialyzer warning when nil values are set for the indexed topics of an EventFilter:

The function call will not succeed.

Ethers.Contracts.ERC20.EventFilters.transfer(nil, nil)

breaks the contract
(Ethers.Types.t_address(), Ethers.Types.t_address()) :: Ethers.EventFilter.t()

But the indexed topics are nullable.

This PR fixes the typespec by making the arguments nullable for EventFilters.

The current typespec generator emits a dialyzer warning when nil values are set for the indexed topics of an `EventFilter`:

```elixir
The function call will not succeed.

Ethers.Contracts.ERC20.EventFilters.transfer(nil, nil)

breaks the contract
(Ethers.Types.t_address(), Ethers.Types.t_address()) :: Ethers.EventFilter.t()
```

This can be fixed by making the arguments nullable for events.
Copy link
Member

@alisinabh alisinabh left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. 🙏💜

Will fix CI issues and merge this PR soon.

@alisinabh alisinabh merged commit ca26505 into ExWeb3:main Oct 14, 2024
4 checks passed
@NduatiK NduatiK deleted the patch-1 branch October 14, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants