feat: add Word::empty() method to Miden SDK#826
feat: add Word::empty() method to Miden SDK#826PivasDesant wants to merge 8 commits into0xMiden:nextfrom
Conversation
bitwalker
left a comment
There was a problem hiding this comment.
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.
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.