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

test: implement miner sector event extractor tests #999

Merged
merged 4 commits into from
Jun 29, 2022

Conversation

frrist
Copy link
Member

@frrist frrist commented Jun 21, 2022

No description provided.

@frrist frrist self-assigned this Jun 21, 2022
@frrist frrist requested review from kasteph and placer14 June 21, 2022 01:40
Comment on lines -43 to +45
for i, sector := range sectors {
sectorChanges.Added[i] = *sector
for _, sector := range sectors {
sectorChanges.Added = append(sectorChanges.Added, *sector)
Copy link
Member Author

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())
Copy link
Member Author

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-commenter
Copy link

Codecov Report

Merging #999 (0ff8e66) into frrist/miner-sector-deals-test (5de5fd0) will increase coverage by 3.9%.
The diff coverage is 71.4%.

@@                       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     

@frrist frrist changed the title implement miner sector event extractor tests test: implement miner sector event extractor tests Jun 21, 2022
Copy link
Contributor

@placer14 placer14 left a 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.)

tasks/actorstate/miner/sector_events.go Outdated Show resolved Hide resolved
tasks/actorstate/miner/sector_events.go Outdated Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Outdated Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Outdated Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Outdated Show resolved Hide resolved
tasks/actorstate/miner/sector_events_test.go Outdated Show resolved Hide resolved
Base automatically changed from frrist/miner-sector-deals-test to master June 23, 2022 00:25
@frrist frrist force-pushed the frrist/miner-sector-events-test branch 2 times, most recently from f705871 to faa82b0 Compare June 28, 2022 19:51
@frrist frrist force-pushed the frrist/miner-sector-events-test branch from faa82b0 to 1082f66 Compare June 29, 2022 01:01
@frrist frrist merged commit c249b67 into master Jun 29, 2022
@frrist frrist deleted the frrist/miner-sector-events-test branch June 29, 2022 01:19
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.

4 participants