-
Notifications
You must be signed in to change notification settings - Fork 278
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
test: fuzz share commitments #1749
Conversation
pkg/square/testdata/fuzz/FuzzSquareShareCommitments/dabfc57957837b0a
Outdated
Show resolved
Hide resolved
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.
dope!
pkg/square/builder.go
Outdated
func (b *Builder) NumTxs() int { | ||
return len(b.txs) | ||
return len(b.txs) + len(b.pfbs) | ||
} |
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.
[optional] this function may warrant a clarifying godoc
// NumTxs returns the total number of txs (PFBs + normalTxs)
func (b *Builder) NumTxs() int {
return len(b.txs) + len(b.pfbs)
}
we may also consider renaming the field b.txs
=> b.normalTxs
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 not 100% convinced about normal txs. I don't like that normality is defined on the basis of whether there is a PFB or not
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 open to other names to help disambiguate. Candidates: nonPFBTxs
@@ -52,7 +52,7 @@ func FuzzSquare(f *testing.F) { | |||
builder, err := square.NewBuilder(appconsts.DefaultMaxSquareSize, orderedTxs...) | |||
require.NoError(t, err) | |||
totalPfbs := builder.NumPFBs() | |||
totalNormalTxs := builder.NumTxs() | |||
totalNormalTxs := builder.NumTxs() - totalPfbs |
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.
[optional] an exported function on the builder for normal txs: builder.NumNormalTxs()
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 think I'll wait for the need to arise first
Codecov Report
@@ Coverage Diff @@
## main #1749 +/- ##
==========================================
+ Coverage 51.93% 52.00% +0.06%
==========================================
Files 94 94
Lines 6084 6088 +4
==========================================
+ Hits 3160 3166 +6
+ Misses 2596 2594 -2
Partials 328 328
|
Closes: #1744, closes: #1747