Repository navigation
fix(account-abstraction): forward falsy per-operation paymasterContext instead of the bundler client default - #5421
Closed
saravanan619 wants to merge 3 commits into
Closed
saravanan619 wants to merge 3 commits into
saravanan619 wants to merge 3 commits into
Conversation
…t instead of the bundler client default (wevm#5418)
|
@saravanan619 is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 9758ed1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Member
|
Thanks for the fix! I'm closing this in favour of #5431. It keeps your source change unchanged, credits you as co-author, and moves the regression test into the existing Generated by Claude Code |
jxom
added a commit
that referenced
this pull request
Nov 6, 2026
…ver the client default (#5431) `prepareUserOperation` chose between the per-operation `paymasterContext` and the bundler client default with a truthiness check, so `false`, `0`, `''`, and `null` were replaced by the default. Only `undefined` now falls back to the client default. Fixes #5418. Supersedes #5421. Claude-Session: https://claude.ai/code/session_01D3nmWjV2LuSbn2SFpBG1hn Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Saravanan <76141249+saravanan619@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5418.
prepareUserOperationchose between the per-operationpaymasterContextand the bundler client's default with a truthinesstest, but the option is typed
unknown, sofalse,0, and''arelegitimate values. Any of them was treated as "not provided": with a
client default, the default was silently passed to
getPaymasterStubData/getPaymasterDatainstead of the explicitoverride; without one, the explicit value was erased to
undefined.A caller therefore could not opt a single operation out of a
bundler-level default sponsorship context (e.g. with
paymasterContext: false), and a paymaster callback that distinguishes"no context" from "explicitly false/empty" could never see the
distinction.
Changes
src/account-abstraction/actions/bundler/prepareUserOperation.ts:select on presence (
!== undefined) instead of truthiness, so theclient default applies only when the per-operation option is absent.
nullis still forwarded verbatim, matching the declaredunknowntype; only
undefinedmeans "not supplied".src/account-abstraction/actions/bundler/prepareUserOperation.paymasterContext.test.ts:new offline regression tests that run
prepareUserOperationwithparameters: ['paymaster']against a real local HTTP paymasterserver whose returned
paymasterDataencodes the context itreceived, asserting on the prepared User Operation output:
false,0, and''overrides are forwarded instead of the client default,a truthy object override still wins,
undefinedstill falls back tothe client default, and a falsy override is preserved when no client
default exists.
.changeset/paymaster-context-presence.md: patch changeset.Verification
one-line fix makes the 4 falsy-override cases fail (the 2
fallback/truthy controls still pass), re-applying it makes all 6
pass.
tsc -b srcpasses; the new test file typechecks clean; Biomecheck passes on both changed source files.
prepareUserOperation.test.tssuite (it needs an anvil + alto bundler harness, unavailable in this
environment). The change is a single presence-vs-truthiness selection
with no effect on truthy/undefined inputs, which the existing
args: paymasterContextandbehavior: bundlerClient.paymasterContexttests already cover.