Skip to content

Commit

Permalink
address review; flush tablewriter
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Feb 5, 2021
1 parent a4ddf92 commit 8614e29
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ type AddressConfig struct {
// PendingDealInfo has info about pending deals and when they are due to be
// published
type PendingDealInfo struct {
Deals []*market.ClientDealProposal
Deals []market.ClientDealProposal
PublishPeriodStart time.Time
PublishPeriod time.Duration
}
6 changes: 3 additions & 3 deletions api/apistruct/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ type StorageMinerStruct struct {
MarketGetRetrievalAsk func(ctx context.Context) (*retrievalmarket.Ask, error) `perm:"read"`
MarketListDataTransfers func(ctx context.Context) ([]api.DataTransferChannel, error) `perm:"write"`
MarketDataTransferUpdates func(ctx context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"`
MarketRestartDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"read"`
MarketCancelDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"read"`
MarketPendingDeals func(ctx context.Context) (api.PendingDealInfo, error) `perm:"admin"`
MarketRestartDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"`
MarketCancelDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"`
MarketPendingDeals func(ctx context.Context) (api.PendingDealInfo, error) `perm:"write"`
MarketPublishPendingDeals func(ctx context.Context) error `perm:"admin"`

PledgeSector func(context.Context) error `perm:"write"`
Expand Down
4 changes: 2 additions & 2 deletions cmd/lotus-storage-miner/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,14 @@ var dealsPendingPublish = &cli.Command{
_, _ = fmt.Fprintf(w, "ProposalCID\tClient\tSize\n")

for _, deal := range pending.Deals {
proposalNd, err := cborutil.AsIpld(deal)
proposalNd, err := cborutil.AsIpld(&deal) // nolint:gosec
if err != nil {
return err
}

_, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", proposalNd.Cid(), deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize)))
}

return nil
return w.Flush()
},
}
6 changes: 3 additions & 3 deletions documentation/en/api-methods-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ Response: `{}`
MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer


Perms: read
Perms: write

Inputs:
```json
Expand Down Expand Up @@ -730,7 +730,7 @@ Response: `null`
### MarketPendingDeals
There are not yet any comments for this method.

Perms: admin
Perms: write

Inputs: `null`

Expand All @@ -756,7 +756,7 @@ Response: `{}`
MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer


Perms: read
Perms: write

Inputs:
```json
Expand Down
4 changes: 2 additions & 2 deletions markets/storageadapter/dealpublisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ func (p *DealPublisher) PendingDeals() api.PendingDealInfo {
}
}

pending := make([]*market2.ClientDealProposal, len(deals))
pending := make([]market2.ClientDealProposal, len(deals))
for i, deal := range deals {
pending[i] = &deal.deal
pending[i] = deal.deal
}

return api.PendingDealInfo{
Expand Down

0 comments on commit 8614e29

Please sign in to comment.