-
Notifications
You must be signed in to change notification settings - Fork 7
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
Generate unique beacon per each fake EC tipset #752
Conversation
Generate a unique bacon per each tipset created by fake ec for better testing.
301b697
to
6d150a3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
==========================================
- Coverage 69.58% 69.32% -0.27%
==========================================
Files 74 74
Lines 7497 7494 -3
==========================================
- Hits 5217 5195 -22
- Misses 1868 1885 +17
- Partials 412 414 +2
|
@@ -159,15 +145,22 @@ func (ec *FakeEC) genTipset(epoch int64) *tipset { | |||
tsk = append(tsk, cidPrefixBytes...) | |||
tsk = append(tsk, digest...) | |||
} | |||
|
|||
h.Reset() | |||
h.Write([]byte(fmt.Sprintf("beacon %d", epoch))) |
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 would make it dependant on seed but not critical and for sure better than it was.
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.
The hasher h
is keyed by seed already. That should do it right?
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.
Ahh, you are probably right. I forgot that we have a keyed hasher.
Generate a unique bacon per each tipset created by fake ec for better testing.