Skip to content

Conversation

@PivasDesant
Copy link

Fixes #822

I've added a Word::empty() method that returns a Word with all four field elements set to zero. This replaces the repetitive Word::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.

Copy link
Collaborator

@bitwalker bitwalker left a 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 {
Copy link
Collaborator

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.

@PivasDesant
Copy link
Author

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.

So before doing an issue I should be assigned to it?

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.

Add Word::empty() in the Miden SDK

2 participants