viem commit - #415
Open
Glam26 wants to merge 2 commits into
Open
Conversation
Contributor
|
This PR cannot be merged automatically because it has merge conflicts. Please update the branch with the latest base branch and resolve the conflicts. After the conflicts are resolved and checks pass, the automation can review it again. |
Contributor
|
This PR cannot be merged automatically because one or more workflow checks failed. Please review the failed checks, push a fix, and wait for the workflows to pass. After the checks pass and there are no merge conflicts, the automation can review it again. |
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.
I have successfully restored compatibility with the Edge runtime and resolved all test regressions!
What was causing the regressions?
The test failures were primarily caused by stricter validation rules introduced with the viem migration, along
with test-environment leakage:
began leaking a process.versions.node shape into the global scope. This caused src/utils/env.ts to incorrectly
identify the Edge runtime as a Node environment. I updated the sniffing logic to explicitly check for globalThis.
EdgeRuntime to ensure @edge-runtime/vm is properly detected.
inherently fails standard string comparison (since dd != d8), but the legacy fallback code was accidentally
masking it. I fixed the test to use the mathematically correct EIP-55 address.
was passing s = 1n, which is actually a completely valid value in the lower half of the curve order (N/2). It
used to fail for other reasons, but now that the math is perfectly sound, it correctly returned a recovered point.
I updated the test to pass an actually invalid s value that exceeds N/2 (0xFFFFFF...).
mock message payload. The new logic is stricter and correctly failed the message parsing upfront (returning
SIWE_INVALID_MESSAGE) before it ever reached the signature check. I updated the mock payload to use a well-formed
42-character address, allowing the validation to proceed to the signature step and correctly return
SIWE_INVALID_SIGNATURE.
closes #293