diff --git a/api/api_full.go b/api/api_full.go index 13add2130..db49f3571 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -178,9 +178,10 @@ type Import struct { type DealInfo struct { ProposalCid cid.Cid State storagemarket.StorageDealStatus + Message string // more information about deal state, particularly errors Provider address.Address - PieceRef []byte // cid bytes + PieceCID cid.Cid Size uint64 PricePerEpoch types.BigInt diff --git a/cli/client.go b/cli/client.go index d8af62fd1..9f6b12e69 100644 --- a/cli/client.go +++ b/cli/client.go @@ -429,9 +429,9 @@ var clientListDeals = &cli.Command{ } 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 { - 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() }, diff --git a/node/impl/client/client.go b/node/impl/client/client.go index dcc61866a..ea8d57c6b 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -3,10 +3,11 @@ package client import ( "context" "errors" - "github.com/filecoin-project/sector-storage/ffiwrapper" "io" "os" + "github.com/filecoin-project/sector-storage/ffiwrapper" + "github.com/filecoin-project/specs-actors/actors/abi/big" "golang.org/x/xerrors" @@ -125,9 +126,10 @@ func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) { out[k] = api.DealInfo{ ProposalCid: v.ProposalCid, State: v.State, + Message: v.Message, Provider: v.Proposal.Provider, - PieceRef: v.Proposal.PieceCID.Bytes(), + PieceCID: v.Proposal.PieceCID, Size: uint64(v.Proposal.PieceSize.Unpadded()), PricePerEpoch: v.Proposal.StoragePricePerEpoch, @@ -148,8 +150,9 @@ func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, return &api.DealInfo{ ProposalCid: v.ProposalCid, State: v.State, + Message: v.Message, Provider: v.Proposal.Provider, - PieceRef: v.Proposal.PieceCID.Bytes(), + PieceCID: v.Proposal.PieceCID, Size: uint64(v.Proposal.PieceSize.Unpadded()), PricePerEpoch: v.Proposal.StoragePricePerEpoch, Duration: uint64(v.Proposal.Duration()),