Implement proper Arbitrary trait for ZkLoginInputs property testing#553
Draft
Copilot wants to merge 8 commits intomove-core-sdkfrom
Draft
Implement proper Arbitrary trait for ZkLoginInputs property testing#553Copilot wants to merge 8 commits intomove-core-sdkfrom
Copilot wants to merge 8 commits intomove-core-sdkfrom
Conversation
* feat: Use Version struct over type def * bindings and doc test * replace sequence number mentions * bindings again * regenerate * kotlin lib without prefix * Apply suggestions from code review * centralize cfg_attr tags * bindings * fix version in gas station data * fix gas station string or num * use Version everywhere * privatize consts * make `Version` private * fix docs * implement PartialEq and PartialOrd traits for Version and u64 * allow deserializing from number or string * fix BCS deserialization * derives * revert some changes with serialization * Remove schemars tag from version --------- Co-authored-by: Thibault Martinez <thibault@iota.org>
#529) * feat(types): enhance Address with system package constants and methods - Add GENESIS_BRIDGE and STARDUST system package constants - Rename from_u8 to from_u16 to support larger package IDs - Add is_system_package() method - Add const fn from_object_id conversion - Add random() method behind 'rand' feature flag - Add next_lexicographical method - Rename into_inner/inner to into_bytes/bytes for consistency * fix some issues * bindings * update random address generation to exclude wasm32 target * Update crates/iota-sdk-types/src/address.rs Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> * dedup --------- Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com>
* feat(types): enhance ObjectId with system constants and methods - Add GENESIS_BRIDGE and STARDUST system package constants - Add const fn from_address conversion - Add from_bytes constructor - Add next_lexicographical method - Add random() method behind 'rand' feature flag - Rename into_inner/inner to into_bytes/bytes for consistency * add ObjectId::MAX * add ObjectId::from_u16 * Divide from_hex and from_short_hex * add ObjectId::is_system_package * refactor hex methods * update bindings * add more ObjectId constants * add from_prefixed_hex and from_prefixed_short_hex * update bindings * increase UniffiLibBatch2 size * fix Address FromStr so that non-prefixed short strings are not accepted * bindings * improve object id debug --------- Co-authored-by: /alex/ <alexander.schmidt@iota.org>
- Add GENESIS constant for genesis digest marker - Add UpperHex formatting support - Add const fn improvements (inner, as_bytes, from_bytes) - Add is_alive, is_deleted, is_wrapped methods for ObjectDigest - Add next_lexicographical method - Add random() method behind 'rand' feature flag
- Replace hardcoded values with proper property-based test generation - Generate valid base64url-encoded JWT headers dynamically - Generate valid ZkLoginClaim values with proper iss field encoding - All tests passing including serialization_proptests Co-authored-by: DaughterOfMars <18284021+DaughterOfMars@users.noreply.github.com>
Add explanatory comments for why fixed values are used for index_mod_4 and JWT header fields in the property-based testing implementation Co-authored-by: DaughterOfMars <18284021+DaughterOfMars@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement TODO in lib.rs for iota-sdk-types
Implement proper Arbitrary trait for ZkLoginInputs property testing
Feb 2, 2026
668d54f to
c3c9c67
Compare
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.
The
Arbitraryimplementation forZkLoginInputsused hardcoded test values instead of generating them dynamically, limiting property-based test coverage.Changes
ZkLoginClaim generation: Generates random issuer values, creates properly formatted extended claims (
"iss":"https://<random>.example.com",), and encodes as base64url. Usesindex_mod_4 = 0to avoid bit padding complexity.JWT header generation: Dynamically creates and base64url-encodes valid JWT headers with required
alg,kid, andtypfields.Before/After
All 367 tests pass with the new implementation.
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.