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

Made node_index_in_block method return u32 #814

Merged
merged 5 commits into from
Aug 2, 2024
Merged

Conversation

polydez
Copy link
Contributor

@polydez polydez commented Aug 2, 2024

We had changed construction of node_index_in_block to u32, but the getter still converts it to u64. This PR fixes that.

@polydez polydez requested review from igamigo and bobbinth August 2, 2024 07:31
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left just one comment inline.

Comment on lines 27 to 29
/// The height of the Merkle tree is `BLOCK_OUTPUT_NOTES_TREE_DEPTH`. Thus, the maximum index
/// is `2 ^ BLOCK_OUTPUT_NOTES_TREE_DEPTH - 1`.
pub fn node_index_in_block(&self) -> u64 {
self.node_index_in_block as u64
pub fn node_index_in_block(&self) -> u32 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename the constant mentioned here to just BLOCK_NOTES_TREE_DEPTH and also change this to be a link to the constant - i.e., [BLOCK_NOTES_TREE_DEPTH].

Similarly, I'd rename BATCH_OUTPUT_NOTES_TREE_DEPTH to just BATCH_NOTES_TREE_DEPTH.

@polydez polydez merged commit 493e193 into next Aug 2, 2024
13 checks passed
@polydez polydez deleted the polydez-node-index-u32 branch August 2, 2024 07:58
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.

2 participants