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

Rethrow the original eth_sendTransaction error if wallet_sendTransaction isn't supported #2965

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

alcuadrado
Copy link
Contributor

@alcuadrado alcuadrado commented Nov 5, 2024

This is an initial stub at rethrowing the original eth_sendTransaction error if wallet_sendTransaction error isn't supported.

I also modified the code a bit, so that wallet_sendTransaction is only tried once per client if not supported.


PR-Codex overview

This PR focuses on improving error handling in the sendTransaction function by ensuring that original errors are rethrown when the wallet_sendTransaction method is not supported. It enhances the logic for determining method support and improves test coverage.

Detailed summary

  • Fixed error bubbling for sendTransaction when wallet_sendTransaction isn't supported.
  • Introduced a check to determine if the wallet namespace is supported.
  • Updated error handling to rethrow original errors for unsupported methods.
  • Added a test to verify behavior when wallet_sendTransaction is unsupported.

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

Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: 9d4e917

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 5, 2024

@alcuadrado is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@jxom jxom merged commit eb18632 into wevm:main Nov 5, 2024
2 of 3 checks passed
@github-actions github-actions bot mentioned this pull request Nov 5, 2024
@alcuadrado alcuadrado deleted the rethrow-original-error branch November 7, 2024 10:16
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