remove WpostProvignPeriod function

This commit is contained in:
Steven Allen 2020-09-17 14:53:57 -07:00
parent 708aa368e1
commit ae38970526
3 changed files with 2 additions and 19 deletions

View File

@ -4,11 +4,6 @@ import (
"context"
"fmt"
"github.com/filecoin-project/lotus/api/apibstore"
"github.com/filecoin-project/lotus/chain/actors/adt"
lotusminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
cbor "github.com/ipfs/go-ipld-cbor"
"os"
"strings"
"testing"
@ -182,14 +177,6 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector
require.Equal(t, p.MinerPower, p.TotalPower)
require.Equal(t, p.MinerPower.RawBytePower, types.NewInt(uint64(ssz)*uint64(nSectors+GenesisPreseals)))
store := cbor.NewCborStore(apibstore.NewAPIBlockstore(client))
mact, err := client.StateGetActor(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
minState, err := lotusminer.Load(adt.WrapStore(ctx, store), mact)
require.NoError(t, err)
fmt.Printf("Drop some sectors\n")
// Drop 2 sectors from deadline 2 partition 0 (full partition / deadline)
@ -254,7 +241,7 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > di.PeriodStart+(minState.WpostProvingPeriod())+2 {
if head.Height() > di.PeriodStart+(di.WPoStProvingPeriod)+2 {
break
}
@ -284,7 +271,7 @@ func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSector
head, err := client.ChainHead(ctx)
require.NoError(t, err)
if head.Height() > di.PeriodStart+(minState.WpostProvingPeriod())+2 {
if head.Height() > di.PeriodStart+di.WPoStProvingPeriod+2 {
break
}

View File

@ -51,7 +51,6 @@ type State interface {
Info() (MinerInfo, error)
DeadlineInfo(epoch abi.ChainEpoch) *dline.Info
WpostProvingPeriod() abi.ChainEpoch
}
type Deadline interface {

View File

@ -243,9 +243,6 @@ func (s *v0State) Info() (MinerInfo, error) {
func (s *v0State) DeadlineInfo(epoch abi.ChainEpoch) *dline.Info {
return s.State.DeadlineInfo(epoch)
}
func (s *v0State) WpostProvingPeriod() abi.ChainEpoch {
return v0miner.WPoStProvingPeriod
}
func (d *v0Deadline) LoadPartition(idx uint64) (Partition, error) {
p, err := d.Deadline.LoadPartition(d.store, idx)