Skip to content

Commit

Permalink
chore: test: refactor, fix and improve unmanaged miner
Browse files Browse the repository at this point in the history
from niporep work, including some necessary bits from there but are useful in
general
  • Loading branch information
rvagg committed Jun 25, 2024
1 parent dcd9528 commit 6ac252a
Show file tree
Hide file tree
Showing 3 changed files with 351 additions and 228 deletions.
5 changes: 4 additions & 1 deletion itests/kit/blockminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func newPartitionTracker(ctx context.Context, t *testing.T, client v1api.FullNod

parts, err := client.StateMinerPartitions(ctx, minerAddr, dlIdx, types.EmptyTSK)
require.NoError(t, err)

return &partitionTracker{
minerAddr: minerAddr,
partitions: parts,
Expand Down Expand Up @@ -245,7 +246,9 @@ func (bm *BlockMiner) MineBlocksMustPost(ctx context.Context, blocktime time.Dur
dlinfo, err := bm.miner.FullNode.StateMinerProvingDeadline(ctx, minerAddr, ts.Key())
require.NoError(bm.t, err)
require.NotNil(bm.t, dlinfo, "no deadline info for miner %s", minerAddr)
impendingDeadlines = append(impendingDeadlines, minerDeadline{addr: minerAddr, deadline: *dlinfo})
if dlinfo.Open < dlinfo.CurrentEpoch {
impendingDeadlines = append(impendingDeadlines, minerDeadline{addr: minerAddr, deadline: *dlinfo})
} // else this is probably a new miner, not starting in this proving period
}
bm.postWatchMinersLk.Unlock()
impendingDeadlines = impendingDeadlines.FilterByLast(ts.Height() + 5 + abi.ChainEpoch(nulls))
Expand Down
Loading

0 comments on commit 6ac252a

Please sign in to comment.