-
Notifications
You must be signed in to change notification settings - Fork 54
feat: add Word::empty() method to Miden SDK #826
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
base: next
Are you sure you want to change the base?
Conversation
bitwalker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! For future reference, we'd prefer if unsolicited PRs refer back to a previously reported issue in the tracker, to avoid people working on things that we are already working on, or that might be wasted effort (e.g. updating code that is being removed). In general we close/reject PRs that don't follow that process.
I've left a comment here with a change I'd like to make before this is merged, other than that, looks good to me.
| } | ||
|
|
||
| /// Creates a new `Word` with all four field elements set to zero. | ||
| pub fn empty() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's implement this via the Default trait instead, which makes it more generally useful anyway.
So before doing an issue I should be assigned to it? |
Fixes #822
I've added a
Word::empty()method that returns a Word with all four field elements set to zero. This replaces the repetitiveWord::from([Felt::from_u32(0); 4])pattern we had scattered across the test files.Updated all 5 occurrences in the integration tests to use the new method.