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

Arity is already available as an associated constant. #2259

Merged
merged 3 commits into from
Nov 6, 2024
Merged

Arity is already available as an associated constant. #2259

merged 3 commits into from
Nov 6, 2024

Conversation

tbro
Copy link
Contributor

@tbro tbro commented Nov 5, 2024

I think it is slightly better if we always access the associated constant instead of duplicating it into a stand-alone constant in addition to the associated one.

I think it is slightly better if we always access the associated
constant instead of duplicating it into a stand alone constant as well
as the associated one.
@@ -15,12 +15,11 @@ use std::collections::HashSet;
pub type BlockMerkleTree = LightWeightSHA3MerkleTree<Commitment<Header>>;
pub type BlockMerkleCommitment = <BlockMerkleTree as MerkleTreeScheme>::Commitment;

pub type FeeMerkleTree = UniversalMerkleTree<FeeAmount, Sha3Digest, FeeAccount, FEE_MERKLE_TREE_ARITY, Sha3Node>;
pub type FeeMerkleTree = UniversalMerkleTree<FeeAmount, Sha3Digest, FeeAccount, 256, Sha3Node>;
Copy link
Collaborator

@sveitser sveitser Nov 6, 2024

Choose a reason for hiding this comment

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

I think now it's harder to know what the 256 is for if you just look the code outside an editor. I think it would be fine to keep the constant just for that. Could make it not pub though, or just put a comment /* arity */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tbro tbro merged commit 1a998c2 into main Nov 6, 2024
17 checks passed
@tbro tbro deleted the tb/arity branch November 6, 2024 15:09
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