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

test: demonstrate callstack in extended client action #2680

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

holic
Copy link
Contributor

@holic holic commented Aug 31, 2024

Continued from #2675

  • replaces base actions to avoid RPC calls
  • demonstrates callstack of inner action calls

PR-Codex overview

The focus of this PR is to refactor and extend action composition in the createClient module.

Detailed summary

  • Added type definition for Client
  • Refactored action composition logic in createClient
  • Added new actions getChainId and estimateGas
  • Updated tests to reflect changes in action composition logic

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

Copy link

changeset-bot bot commented Aug 31, 2024

⚠️ No Changeset found

Latest commit: a701aa8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Aug 31, 2024

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

A member of the Team first needs to authorize it.

@holic holic marked this pull request as ready for review August 31, 2024 11:21
'estimateGas:first',
'estimateGas:base',
'getChainId:base',
])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the functionality I was trying to understand, where I hoped that this would look more like

[
  'estimateGas:second',
  'estimateGas:first',
  'estimateGas:base',
  'getChainId:second',
  'getChainId:first',
  'getChainId:base',
]

Copy link
Member

@jxom jxom Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could consider binding them (in Viem) to behave like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the consequences of that. Would that be a breaking change because it would change the behavior of the entire callstack of extended clients?

I was thinking of writing a separate "compose" decorator wrapper that could handle this.

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