fix: resolve confirmed v0.40-dev bug-hunt findings#395
Open
MuncleUscles wants to merge 2 commits into
Open
Conversation
Adds intentionally-failing unit tests under tests/bugs/ that reproduce real
instability / wrong-result bugs found in the v0.40-dev line. Each test pins the
correct behavior and documents the source location, root cause, a concrete
reproduction, and a suggested fix direction. A follow-up change should fix the
underlying bug in src/ so these go green.
Bugs covered:
- contracts/index.ts arg parsing: crash on non-integer numeric args
(BigInt("1.5")); empty-string arg becomes number 0; odd-length b# hex drops
the last nibble; JSON args containing a float silently degrade to a raw
string (structure lost).
- wallet/browserSend.ts: nextLabel is cleared only on success, so a failed send
leaks its signing label onto the next transaction.
- wallet/browserBridge.ts: POST /api/connected accepts an empty/malformed body
and marks the bridge connected with an empty-string address.
- staking/StakingAction.ts: --staking-address without --network mutates the
shared BUILT_IN_NETWORKS singleton, leaking the address process-wide.
- vesting/validatorSetIdentity.ts: --extra-cid 0x... is UTF-8 re-encoded instead
of hex passthrough, corrupting on-chain identity bytes.
- staking/validatorExit.ts: a confirmed exit is reported as "Failed to exit"
when the cosmetic post-exit getEpochInfo() read transiently fails.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ja7QCkNnYByMDLou3qah6H
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Member
Author
|
/run-e2e default v0.6 |
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.
What
Adds regression coverage and fixes all 13 failures from the v0.40-dev bug hunt.
The fixes cover:
Address fixtures in the existing wallet-session tests were updated to valid EVM addresses so they exercise the stricter validation path correctly.
Validation
npm run buildnpm test -- --run --reporter=dot— 805 passedgit diff --check