address review; flush tablewriter

This commit is contained in:
Łukasz Magiera 2021-02-05 22:26:37 +01:00
parent a4ddf9225f
commit 3ff6a6f59f
5 changed files with 11 additions and 11 deletions

View File

@ -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
}

View File

@ -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"`

View File

@ -862,7 +862,7 @@ 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
if err != nil {
return err
}
@ -870,6 +870,6 @@ var dealsPendingPublish = &cli.Command{
_, _ = 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()
},
}

View File

@ -529,7 +529,7 @@ Response: `{}`
MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
Perms: read
Perms: write
Inputs:
```json
@ -730,7 +730,7 @@ Response: `null`
### MarketPendingDeals
There are not yet any comments for this method.
Perms: admin
Perms: write
Inputs: `null`
@ -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

View File

@ -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{