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

Updating readContract args to take in any for the value #300

Merged
merged 5 commits into from
Oct 19, 2024

Conversation

rohan-agarwal-coinbase
Copy link
Contributor

What changed? Why?

The current Record<String, String> interface for args is too strict, as it's possible for some read functions to take in a nested type. We have a potential fix for args that works with nested types but it needs more testing. This PR instead sets it to any, which is much more permissive. It still however gives proper type-inference and shows the type that will be returned when a match occurs.

I changed from unknowns and never to be any which is to be more permissive. Until we have rock solid type-inference, this feels more appropriate.

Testing

  • Existing unit tests pass
  • The bug that a user hit due to Record<String, String> now works without them having to do as unknown as Record<String, String> which was the temporary fix.
  • My local e2e test script correctly does type-inference in my IDE, and the values returned from the script are correct.

Qualified Impact

@rohan-agarwal-coinbase rohan-agarwal-coinbase merged commit 4fc7755 into v0.9.1 Oct 19, 2024
4 checks passed
@rohan-agarwal-coinbase rohan-agarwal-coinbase deleted the rohan/hotfix-nested-args branch October 19, 2024 01:49
@rohan-agarwal-coinbase rohan-agarwal-coinbase restored the rohan/hotfix-nested-args branch October 19, 2024 01:54
rohan-agarwal-coinbase added a commit that referenced this pull request Oct 19, 2024
* Updating readContract args to take in any for the value (#300)

* Updated docs (#302)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants