Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update array handling in Provable.toFields #285

Merged
merged 10 commits into from
Aug 21, 2024

Conversation

ymekuria
Copy link
Contributor

@ymekuria ymekuria commented Jul 16, 2024

Summary

This PR addresses an issue with incorrect array handling in the provable.toFields() method.

Impact

The resulting conversion to fields could be invalid. Certain field elements may be silently ignored.

Changes

  • Dynamic checks added in toFields to make sure that typeObj and obj have the same length.
  • Check added to ensure obj is an array if typeObj is an array.
  • Error message added if typeObj and obj have different lengths.
  • Error message added if typeObj is an array and obj is not.

o1js: o1-labs/o1js#1791

@ymekuria ymekuria requested a review from MartinMinkov July 18, 2024 03:17
@ymekuria ymekuria changed the title Update array handeling in Provable.toFields Update array handling in Provable.toFields Aug 14, 2024
@ymekuria ymekuria merged commit 84e3196 into main Aug 21, 2024
1 check passed
@ymekuria ymekuria deleted the feature/tofields-array-handling branch August 21, 2024 17:59
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.

3 participants