Skip to content

Commit

Permalink
Self-review cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed May 30, 2021
1 parent f3bf773 commit 49ffbca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 12 additions & 3 deletions api/test/deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
Expand Down Expand Up @@ -227,6 +228,9 @@ func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, sta
s := connectAndStartMining(t, b, blocktime, client, miner)
defer s.blockMiner.Stop()

err := miner.MarketSetAsk(s.ctx, big.Zero(), big.Zero(), 200, 128, 32<<30)
require.NoError(t, err)

checkNoPadding := func() {
sl, err := sn[0].SectorsList(s.ctx)
require.NoError(t, err)
Expand All @@ -239,7 +243,7 @@ func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, sta
si, err := sn[0].SectorsStatus(s.ctx, snum, false)
require.NoError(t, err)

fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State)
// fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State)

for _, deal := range si.Deals {
if deal == 0 {
Expand Down Expand Up @@ -278,13 +282,18 @@ func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, sta
sl, err := sn[0].SectorsList(s.ctx)
require.NoError(t, err)
require.Equal(t, len(sl), expectSectors)
//require.LessOrEqual(t, len(sl), expectSectors+1)
}
}

t.Run("4-p1600B", run(1600, 4, 4))
t.Run("4-p513B", run(513, 4, 2))
t.Run("32-p257B", run(257, 32, 8))
if !testing.Short() {
t.Run("32-p257B", run(257, 32, 8))
t.Run("32-p10B", run(10, 32, 2))

// fixme: this appears to break data-transfer / markets in some really creative ways
//t.Run("128-p10B", run(10, 128, 8))
}
}

func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) {
Expand Down
3 changes: 0 additions & 3 deletions markets/storageadapter/ondealsectorcommitted.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
}
}

log.Infow("sub precommit", "deal", dealInfo.DealID)

// Not yet active, start matching against incoming messages
return false, true, nil
}
Expand Down Expand Up @@ -156,7 +154,6 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
for _, did := range params.DealIDs {
if did == res.DealID {
// Found the deal ID in this message. Callback with the sector ID.
log.Infow("deal precommit found", "deal", res.DealID, "sector", params.SectorNumber)
cb(params.SectorNumber, false, nil)
return false, nil
}
Expand Down

0 comments on commit 49ffbca

Please sign in to comment.