Skip to content

fix: Validate Nonce is non-negative#171

Closed
roninjin10 wants to merge 1 commit intomainfrom
fix/issue-112-nonce-validation
Closed

fix: Validate Nonce is non-negative#171
roninjin10 wants to merge 1 commit intomainfrom
fix/issue-112-nonce-validation

Conversation

@roninjin10
Copy link
Contributor

Summary

Test plan

  • Added tests for negative nonce rejection (number, bigint, string)
  • Added tests for uint64 overflow
  • Added tests for invalid format handling
  • Ran Nonce tests - all pass

🤖 Generated with Claude Code

- Nonce.from() now validates negative values, throwing IntegerUnderflowError
- Added uint64 max validation (2^64-1), throwing IntegerOverflowError
- Proper Nonce-specific error messages instead of generic Uint256 errors
- Added comprehensive tests for validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dist Error Error Jan 2, 2026 11:17am
voltaire Error Error Jan 2, 2026 11:17am

Copy link
Contributor Author

@roninjin10 roninjin10 left a comment

Choose a reason for hiding this comment

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

Automated review summary for PR #171 — fix: Validate Nonce is non-negative\n\nTouched areas: Nonce | Files changed: 5 (+116/-7)\n\n- Tests: yes\n- Types & API: yes\n- Docs: ensure behavior is documented where user-facing.\n- Performance: consider micro-allocations in tight loops.\n\nFocus points:\n - Include boundary tests for 0 and very large values.\n\nOutcome: Comment-only review; no blocking issues spotted. Please consider the above suggestions.\n

@roninjin10
Copy link
Contributor Author

Duplicate of merged PR #263 (Nonce validation)

@roninjin10 roninjin10 closed this Jan 4, 2026
@roninjin10 roninjin10 deleted the fix/issue-112-nonce-validation branch January 4, 2026 16:34
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.

Bug: Nonce type doesn't validate non-negative

1 participant