diff --git a/api/test/tape.go b/api/test/tape.go index 466bdd829a5..1bdac390df1 100644 --- a/api/test/tape.go +++ b/api/test/tape.go @@ -6,7 +6,6 @@ import ( "testing" "time" - "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" @@ -73,22 +72,9 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool <-done }() - err = miner.PledgeSector(ctx) + sid, err := miner.PledgeSector(ctx) require.NoError(t, err) - // Wait till done. - var sectorNo abi.SectorNumber - for { - s, err := miner.SectorsList(ctx) // Note - the test builder doesn't import genesis sectors into FSM - require.NoError(t, err) - fmt.Printf("Sectors: %d\n", len(s)) - if len(s) == 1 { - sectorNo = s[0] - break - } - - build.Clock.Sleep(100 * time.Millisecond) - } fmt.Printf("All sectors is fsm\n") @@ -101,7 +87,7 @@ func testTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration, after bool } for { - st, err := miner.SectorsStatus(ctx, sectorNo, false) + st, err := miner.SectorsStatus(ctx, sid.Number, false) require.NoError(t, err) if st.State == successState { break diff --git a/api/test/window_post.go b/api/test/window_post.go index 99d48083688..ce42318b2b2 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -162,7 +162,7 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n, log.Errorf("WAIT") } log.Errorf("PLEDGING %d", i) - err := miner.PledgeSector(ctx) + _, err := miner.PledgeSector(ctx) require.NoError(t, err) }