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

fix(validator): generate abi name if not provided #6981

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

MaxMustermann2
Copy link
Contributor

@MaxMustermann2 MaxMustermann2 commented Apr 16, 2024

In the case of public mappings, the ABI generated has a blank name set. This results in blank ids for such inputs within the JSON schema. Post 1f81ff0, the number of unique ids is used to convert the JSON scheme into Zod, and hence the presence of blank ids is a concern.

This commit generates the abiName if one is not provided, to a value equal to the ${level}/${index}.

Fixes #6965.

Description

Please include a summary of the changes and be sure to follow our Contribution Guidelines.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

In the case of public mappings, the ABI generated has a blank name set.
This results in blank ids for such inputs within the JSON schema. Post
1f81ff0, the number of unique ids is
used to convert the JSON scheme into Zod, and hence the presence of
blank ids is a concern.

This commit generates the `abiName` if one is not provided to a value
equal to the `${level}/${index}`.

Fixes web3#6965.
@MaxMustermann2
Copy link
Contributor Author

CC @SantiagoDevRel

@SantiagoDevRel
Copy link
Member

I'll ping the devs to review this ASAP, @MaxMustermann2 thanks for fixing it!

@luu-alex
Copy link
Contributor

Thanks for the PR! @MaxMustermann2

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.

Web3ValidatorError validates wrong type
5 participants