Skip to content

Commit

Permalink
fix: remove LocatePieceForDealWithinSector (no longer used) (filecoin…
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Mar 25, 2021
1 parent 7ff7573 commit 84c7b98
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 57 deletions.
90 changes: 44 additions & 46 deletions storagemarket/impl/providerstates/provider_states_test.go
Expand Up @@ -1134,40 +1134,39 @@ func generatePublishDealsReturn(t *testing.T) (abi.DealID, []byte) {
}

type nodeParams struct {
MinerAddr address.Address
MinerWorkerError error
ReserveFundsError error
Height abi.ChainEpoch
TipSetToken shared.TipSetToken
ClientMarketBalance abi.TokenAmount
ClientMarketBalanceError error
AddFundsCid cid.Cid
VerifySignatureFails bool
MostRecentStateIDError error
PieceLength uint64
PieceSectorID uint64
PublishDealsError error
PublishDealID abi.DealID
WaitForPublishDealsError error
OnDealCompleteError error
LocatePieceForDealWithinSectorError error
PreCommittedSectorNumber abi.SectorNumber
PreCommittedIsActive bool
DealPreCommittedSyncError error
DealPreCommittedAsyncError error
DealCommittedSyncError error
DealCommittedAsyncError error
WaitForMessageBlocks bool
WaitForMessagePublishCid cid.Cid
WaitForMessageError error
WaitForMessageExitCode exitcode.ExitCode
WaitForMessageRetBytes []byte
WaitForDealCompletionError error
OnDealExpiredError error
OnDealSlashedError error
OnDealSlashedEpoch abi.ChainEpoch
DataCap *verifreg.DataCap
GetDataCapError error
MinerAddr address.Address
MinerWorkerError error
ReserveFundsError error
Height abi.ChainEpoch
TipSetToken shared.TipSetToken
ClientMarketBalance abi.TokenAmount
ClientMarketBalanceError error
AddFundsCid cid.Cid
VerifySignatureFails bool
MostRecentStateIDError error
PieceLength uint64
PieceSectorID uint64
PublishDealsError error
PublishDealID abi.DealID
WaitForPublishDealsError error
OnDealCompleteError error
PreCommittedSectorNumber abi.SectorNumber
PreCommittedIsActive bool
DealPreCommittedSyncError error
DealPreCommittedAsyncError error
DealCommittedSyncError error
DealCommittedAsyncError error
WaitForMessageBlocks bool
WaitForMessagePublishCid cid.Cid
WaitForMessageError error
WaitForMessageExitCode exitcode.ExitCode
WaitForMessageRetBytes []byte
WaitForDealCompletionError error
OnDealExpiredError error
OnDealSlashedError error
OnDealSlashedEpoch abi.ChainEpoch
DataCap *verifreg.DataCap
GetDataCapError error
}

type dealParams struct {
Expand Down Expand Up @@ -1269,18 +1268,17 @@ func makeExecutor(ctx context.Context,
}

node := &testnodes.FakeProviderNode{
FakeCommonNode: common,
MinerAddr: nodeParams.MinerAddr,
MinerWorkerError: nodeParams.MinerWorkerError,
PieceLength: nodeParams.PieceLength,
PieceSectorID: nodeParams.PieceSectorID,
PublishDealsError: nodeParams.PublishDealsError,
PublishDealID: nodeParams.PublishDealID,
WaitForPublishDealsError: nodeParams.WaitForPublishDealsError,
OnDealCompleteError: nodeParams.OnDealCompleteError,
LocatePieceForDealWithinSectorError: nodeParams.LocatePieceForDealWithinSectorError,
DataCap: nodeParams.DataCap,
GetDataCapErr: nodeParams.GetDataCapError,
FakeCommonNode: common,
MinerAddr: nodeParams.MinerAddr,
MinerWorkerError: nodeParams.MinerWorkerError,
PieceLength: nodeParams.PieceLength,
PieceSectorID: nodeParams.PieceSectorID,
PublishDealsError: nodeParams.PublishDealsError,
PublishDealID: nodeParams.PublishDealID,
WaitForPublishDealsError: nodeParams.WaitForPublishDealsError,
OnDealCompleteError: nodeParams.OnDealCompleteError,
DataCap: nodeParams.DataCap,
GetDataCapErr: nodeParams.GetDataCapError,
}

if nodeParams.MinerAddr == address.Undef {
Expand Down
3 changes: 0 additions & 3 deletions storagemarket/nodes.go
Expand Up @@ -100,9 +100,6 @@ type StorageProviderNode interface {
// GetMinerWorkerAddress returns the worker address associated with a miner
GetMinerWorkerAddress(ctx context.Context, addr address.Address, tok shared.TipSetToken) (address.Address, error)

// LocatePieceForDealWithinSector looks up a given dealID in the miners sectors, and returns its sectorID and location
LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, tok shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize, err error)

// GetDataCap gets the current data cap for addr
GetDataCap(ctx context.Context, addr address.Address, tok shared.TipSetToken) (*verifreg.DataCap, error)

Expand Down
8 changes: 0 additions & 8 deletions storagemarket/testnodes/testnodes.go
Expand Up @@ -389,14 +389,6 @@ func (n *FakeProviderNode) GetMinerWorkerAddress(ctx context.Context, miner addr
return address.Undef, n.MinerWorkerError
}

// LocatePieceForDealWithinSector returns stubbed data for a pieces location in a sector
func (n *FakeProviderNode) LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, tok shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize, err error) {
if n.LocatePieceForDealWithinSectorError == nil {
return abi.SectorNumber(n.PieceSectorID), 0, abi.PaddedPieceSize(n.PieceLength), nil
}
return 0, 0, 0, n.LocatePieceForDealWithinSectorError
}

// GetDataCap gets the current data cap for addr
func (n *FakeProviderNode) GetDataCap(ctx context.Context, addr address.Address, tok shared.TipSetToken) (*verifreg.DataCap, error) {
return n.DataCap, n.GetDataCapErr
Expand Down

0 comments on commit 84c7b98

Please sign in to comment.