Merge pull request #1480 from filecoin-project/feat/better-deal-info
Better deal info at the command line
This commit is contained in:
commit
ea135991e3
@ -178,9 +178,10 @@ type Import struct {
|
|||||||
type DealInfo struct {
|
type DealInfo struct {
|
||||||
ProposalCid cid.Cid
|
ProposalCid cid.Cid
|
||||||
State storagemarket.StorageDealStatus
|
State storagemarket.StorageDealStatus
|
||||||
|
Message string // more information about deal state, particularly errors
|
||||||
Provider address.Address
|
Provider address.Address
|
||||||
|
|
||||||
PieceRef []byte // cid bytes
|
PieceCID cid.Cid
|
||||||
Size uint64
|
Size uint64
|
||||||
|
|
||||||
PricePerEpoch types.BigInt
|
PricePerEpoch types.BigInt
|
||||||
|
@ -429,9 +429,9 @@ var clientListDeals = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
||||||
fmt.Fprintf(w, "DealCid\tProvider\tState\tPieceRef\tSize\tPrice\tDuration\n")
|
fmt.Fprintf(w, "DealCid\tProvider\tState\tPieceCID\tSize\tPrice\tDuration\tMessage\n")
|
||||||
for _, d := range deals {
|
for _, d := range deals {
|
||||||
fmt.Fprintf(w, "%s\t%s\t%s\t%x\t%d\t%s\t%d\n", d.ProposalCid, d.Provider, storagemarket.DealStates[d.State], d.PieceRef, d.Size, d.PricePerEpoch, d.Duration)
|
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\t%s\t%d\t%s\n", d.ProposalCid, d.Provider, storagemarket.DealStates[d.State], d.PieceCID, d.Size, d.PricePerEpoch, d.Duration, d.Message)
|
||||||
}
|
}
|
||||||
return w.Flush()
|
return w.Flush()
|
||||||
},
|
},
|
||||||
|
@ -86,7 +86,7 @@ var dealsListCmd = &cli.Command{
|
|||||||
|
|
||||||
ctx := lcli.DaemonContext(cctx)
|
ctx := lcli.DaemonContext(cctx)
|
||||||
|
|
||||||
deals, err := api.DealsList(ctx)
|
deals, err := api.MarketListIncompleteDeals(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,11 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/filecoin-project/sector-storage/ffiwrapper"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/sector-storage/ffiwrapper"
|
||||||
|
|
||||||
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
@ -125,9 +126,10 @@ func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) {
|
|||||||
out[k] = api.DealInfo{
|
out[k] = api.DealInfo{
|
||||||
ProposalCid: v.ProposalCid,
|
ProposalCid: v.ProposalCid,
|
||||||
State: v.State,
|
State: v.State,
|
||||||
|
Message: v.Message,
|
||||||
Provider: v.Proposal.Provider,
|
Provider: v.Proposal.Provider,
|
||||||
|
|
||||||
PieceRef: v.Proposal.PieceCID.Bytes(),
|
PieceCID: v.Proposal.PieceCID,
|
||||||
Size: uint64(v.Proposal.PieceSize.Unpadded()),
|
Size: uint64(v.Proposal.PieceSize.Unpadded()),
|
||||||
|
|
||||||
PricePerEpoch: v.Proposal.StoragePricePerEpoch,
|
PricePerEpoch: v.Proposal.StoragePricePerEpoch,
|
||||||
@ -148,8 +150,9 @@ func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo,
|
|||||||
return &api.DealInfo{
|
return &api.DealInfo{
|
||||||
ProposalCid: v.ProposalCid,
|
ProposalCid: v.ProposalCid,
|
||||||
State: v.State,
|
State: v.State,
|
||||||
|
Message: v.Message,
|
||||||
Provider: v.Proposal.Provider,
|
Provider: v.Proposal.Provider,
|
||||||
PieceRef: v.Proposal.PieceCID.Bytes(),
|
PieceCID: v.Proposal.PieceCID,
|
||||||
Size: uint64(v.Proposal.PieceSize.Unpadded()),
|
Size: uint64(v.Proposal.PieceSize.Unpadded()),
|
||||||
PricePerEpoch: v.Proposal.StoragePricePerEpoch,
|
PricePerEpoch: v.Proposal.StoragePricePerEpoch,
|
||||||
Duration: uint64(v.Proposal.Duration()),
|
Duration: uint64(v.Proposal.Duration()),
|
||||||
|
Loading…
Reference in New Issue
Block a user