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: add zod runtime validation for ethers adapter provider #188

Conversation

avasisht23
Copy link
Contributor

@avasisht23 avasisht23 commented Oct 31, 2023

Pull Request Checklist

  • Did you add new tests and confirm existing tests pass? (yarn test)
  • Did you update relevant docs? (docs are found in the site folder, see guidleines below)
  • Do your commits follow the Conventional Commits standard?
  • Does your PR title also follow the Conventional Commits standard?
  • If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples? (e.g. feat!: breaking change)
  • Did you run lint (yarn lint:check) and fix any issues? (yarn lint:fix)
  • Is the base branch you're merging into development and not main?

PR-Codex overview

Detailed summary

  • Added EthersProviderAdapterOptsSchema schema definition in types.ts.
  • Imported and used EthersProviderAdapterOptsSchema in provider-adapter.ts to validate the options passed to EthersProviderAdapter constructor.
  • Added a test in provider-adapter.test.ts to check runtime validation when the entryPoint is invalid.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

packages/ethers/src/provider-adapter.ts Outdated Show resolved Hide resolved
packages/ethers/src/schema.ts Outdated Show resolved Hide resolved
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from 86c5518 to b1584bc Compare October 31, 2023 03:30
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 5a88163 to 5c2280b Compare October 31, 2023 03:30
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from b1584bc to e6c8f85 Compare November 1, 2023 15:37
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 5c2280b to 700d1b1 Compare November 1, 2023 15:37
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from e6c8f85 to 704518b Compare November 1, 2023 17:03
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 700d1b1 to 4249a75 Compare November 1, 2023 17:03
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from 704518b to 2d27ffb Compare November 1, 2023 17:06
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 4249a75 to a26f1d8 Compare November 1, 2023 17:06
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from 2d27ffb to e28fd37 Compare November 1, 2023 17:27
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from b192f03 to 3fee977 Compare November 1, 2023 17:27
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_alchemy_provider branch from e28fd37 to f9a2c25 Compare November 1, 2023 17:30
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 3fee977 to e67627f Compare November 1, 2023 17:30
@avasisht23 avasisht23 requested a review from denniswon November 1, 2023 17:30
Base automatically changed from 10-30-feat_add_zod_runtime_validation_for_alchemy_provider to development November 2, 2023 02:32
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch 2 times, most recently from 04ce1b8 to 1abeafa Compare November 2, 2023 17:56
packages/ethers/src/provider-adapter.ts Outdated Show resolved Hide resolved
packages/ethers/src/schema.ts Show resolved Hide resolved
@avasisht23 avasisht23 force-pushed the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch from 1abeafa to 64a582c Compare November 2, 2023 19:32
@avasisht23 avasisht23 requested a review from denniswon November 2, 2023 19:35
@avasisht23 avasisht23 merged commit a2b8388 into development Nov 2, 2023
3 checks passed
@avasisht23 avasisht23 deleted the 10-30-feat_add_zod_runtime_validation_for_ethers_adapter_provider branch November 2, 2023 19:57
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