-
Notifications
You must be signed in to change notification settings - Fork 46
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: implement miner sector event extractor tests #999
Conversation
for i, sector := range sectors { | ||
sectorChanges.Added[i] = *sector | ||
for _, sector := range sectors { | ||
sectorChanges.Added = append(sectorChanges.Added, *sector) |
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.
Fixes a panic as we need to append to Added
. This is a rare case when processing the genesis block.
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
sectorEventModel, err := extractSectorEvents(ctx, a, ec, sectorChanges, preCommitChanges) | ||
dlDiff, err := miner.DiffDeadlines(ec.ParentState(), ec.CurrentState()) |
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.
moved to top-level method to improve testability of the different ExtractSector* methods.
Codecov Report
@@ Coverage Diff @@
## frrist/miner-sector-deals-test #999 +/- ##
================================================================
+ Coverage 29.2% 33.2% +3.9%
================================================================
Files 43 43
Lines 2693 2694 +1
================================================================
+ Hits 788 895 +107
+ Misses 1816 1697 -119
- Partials 89 102 +13 |
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.
Really minor nits here on sort if you think it's important to consider. (The sort protection should be applied throughout. I didn't want to mark each one.)
f705871
to
faa82b0
Compare
faa82b0
to
1082f66
Compare
No description provided.