From 8614e2941036d4c3768b207ee522a24ff9cef519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 5 Feb 2021 22:26:37 +0100 Subject: [PATCH] address review; flush tablewriter --- api/api_storage.go | 2 +- api/apistruct/struct.go | 6 +++--- cmd/lotus-storage-miner/market.go | 4 ++-- documentation/en/api-methods-miner.md | 6 +++--- markets/storageadapter/dealpublisher.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/api_storage.go b/api/api_storage.go index 2297c8d6038..eb4584e103a 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -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 } diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index c8659c13c93..ded34ac5ad8 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -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"` diff --git a/cmd/lotus-storage-miner/market.go b/cmd/lotus-storage-miner/market.go index ef4ffcbc504..358cec58419 100644 --- a/cmd/lotus-storage-miner/market.go +++ b/cmd/lotus-storage-miner/market.go @@ -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:gosec 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() }, } diff --git a/documentation/en/api-methods-miner.md b/documentation/en/api-methods-miner.md index a1411ce0ec8..94e26c9f618 100644 --- a/documentation/en/api-methods-miner.md +++ b/documentation/en/api-methods-miner.md @@ -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 diff --git a/markets/storageadapter/dealpublisher.go b/markets/storageadapter/dealpublisher.go index d97756f25b8..157c85ed76f 100644 --- a/markets/storageadapter/dealpublisher.go +++ b/markets/storageadapter/dealpublisher.go @@ -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{