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: generalized url chain id regex check #586

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

VGabriel45
Copy link
Collaborator

@VGabriel45 VGabriel45 commented Oct 10, 2024

Improved regex check for chain id in bundler and paymaster url to fit other url structure's as well.


PR-Codex overview

This PR focuses on enhancing the extractChainIdFromUrl function in Utils.ts by improving error handling and adding documentation. It also introduces unit tests for various URL structures to ensure correct chain ID extraction.

Detailed summary

  • Added JSDoc comments to extractChainIdFromUrl, detailing parameters, return values, and error handling.
  • Improved regex to extract chain ID and added validation for NaN.
  • Enhanced error messages for better clarity.
  • Introduced extractChainIdFromBundlerUrl and extractChainIdFromPaymasterUrl functions, both utilizing extractChainIdFromUrl.
  • Added unit tests in read.test.ts to validate chain ID extraction from multiple URL formats.

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

@VGabriel45 VGabriel45 requested a review from joepegler October 10, 2024 08:09
Copy link

size-limit report 📦

Path Size
core (esm) 55.8 KB (-0.02% 🔽)
core (cjs) 60.99 KB (-0.07% 🔽)
account (tree-shaking) 53.44 KB (+0.07% 🔺)
bundler (tree-shaking) 2.56 KB (+1.87% 🔺)
paymaster (tree-shaking) 2.21 KB (0%)
modules (tree-shaking) 40.98 KB (0%)

@joepegler joepegler merged commit 67ec368 into develop Oct 11, 2024
7 checks passed
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