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(PSDK-586): Read contract support with type inference #295

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

rohan-agarwal-coinbase
Copy link
Contributor

@rohan-agarwal-coinbase rohan-agarwal-coinbase commented Oct 16, 2024

What changed? Why?

  • Installed tsd for testing types directly.
  • Installed viem, abitype for type-inference support
  • Created read_contract.ts with a readContract function that takes in an optional ABI. If an ABI is supplied, it uses type-inference to give compile-time warnings and tell the user the expected return type. Otherwise, unknown is returned.

Testing:

  • Unit tests for the types directly, and unit tests for read contract for all the different types.
  • I also did e2e testing with the backend service changes

Followup:

  • In a separate PR, I'll update our github actions to also test the types with tsd. For now I ran it locally successfully

@cb-heimdall
Copy link

cb-heimdall commented Oct 16, 2024

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@rohan-agarwal-coinbase rohan-agarwal-coinbase marked this pull request as ready for review October 17, 2024 02:04
@rohan-agarwal-coinbase rohan-agarwal-coinbase changed the title Read contract support with type-inference Read contract support with type inference Oct 17, 2024
@rohan-agarwal-coinbase rohan-agarwal-coinbase changed the title Read contract support with type inference feat(PSDK-586): Read contract support with type inference Oct 17, 2024
@rohan-agarwal-coinbase rohan-agarwal-coinbase changed the base branch from master to v0.9.0 October 17, 2024 13:16
@rohan-agarwal-coinbase rohan-agarwal-coinbase merged commit 953cfe9 into v0.9.0 Oct 17, 2024
6 checks passed
@rohan-agarwal-coinbase rohan-agarwal-coinbase deleted the rohan/PSDK-586 branch October 17, 2024 14:38
rohan-agarwal-coinbase added a commit that referenced this pull request Oct 17, 2024
* feat(PSDK-586): Read contract support with type inference (#295)

* Updated to 0.9.0 version and updated docs and changelog (#298)
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