-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Code Health] refactor: SMST#Root(), #Sum(), & #Count() #51
Conversation
Signed-off-by: Bryan White <[email protected]>
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.
Small NIT comment.
Also smst_test.go
seems to use require.Equal(t, uint64(1), impl.Count())
where it should use impl.MustCount()
.
Signed-off-by: Bryan White <[email protected]>
…rit in MerkleSumRoot" This reverts commit a7a3f71.
var countBz [countSizeBytes]byte | ||
copy(countBz[:], []byte(r)[firstCountByteIdx:]) | ||
return binary.BigEndian.Uint64(countBz[:]) | ||
// validateBasic returns an error if the root digest size is not a power of two. |
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.
NIT: Move this comment INSIDE the function and keep the godoc more general OR call out a power of two as an explicit example.
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.
I'm either not quite following or am just unable to think of an alternative godoc comment that satisfies your suggestion. Do you have a concrete example in mind (i.e., validateBasic returns an error if ...
)?
Summary
MerkleSumRoot
SMST#MustCount()
SMST#MustSum()
MerkleSumRoot#MustCount()
MerkleSumRoot#DigestSize()
MerkleSumRoot#HasDigestSize()
SMST#Root()
to returnMerkleSumRoot
Human Summary
AI Summary
reviewpad:summary
Issue
Fixes pokt-network/poktroll#584
Type of change
Please mark the relevant option(s):
Testing
make test_all
make benchmark_{all | suite name}
Required Checklist
godoc
format comments see: tip.golang.org/doc/comment)If Applicable Checklist