Skip to content

fix(zksync): include dependency errors in two action error unions - #5585

Closed
mortezashojaei wants to merge 1 commit into
wevm:mainfrom
mortezashojaei:fix/zksync-dependency-error-unions
Closed

mortezashojaei wants to merge 1 commit into
wevm:mainfrom
mortezashojaei:fix/zksync-dependency-error-unions

Conversation

@mortezashojaei

@mortezashojaei mortezashojaei commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix incomplete error unions for two zkSync actions so consumers can narrow propagated errors by name:

  • Replace BaseErrorType with ReadContractErrorType in GetL1TokenBalanceErrorType. BaseErrorType only describes errors named 'BaseError', so it does not cover propagated contract execution errors.
  • Add GetTransactionReceiptErrorType, ReadContractErrorType, and RequestErrorType to IsWithdrawalFinalizedErrorType to cover failures propagated by its dependencies.

Both unions retain their existing direct-error members. Runtime behavior is unchanged. Includes a patch changeset.

Tests

The four focused type tests pass on this PR and fail against the base implementation. They cover dependency-error assignability and narrowing by error.name, including contract error fields. Biome and whitespace checks pass.

Type tests were run with temporary explicit Vitest type-test discovery, restored afterward. Full workspace typechecking was blocked by local dependency and generated-artifact gaps.

Superseded by #5587. A further address-error fix and regression test was pushed to the source branch after this PR closed; it is not part of this closed PR's diff.

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cd99159

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

jxom commented Nov 18, 2026

Copy link
Copy Markdown
Member

Thanks @mortezashojaei, the union changes are right. I kept your commit and added a small follow-up to the type tests in #5587, which supersedes this PR, so I'm closing this one.

@jxom jxom closed this Nov 18, 2026
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