Add api for getting status given a code

This commit is contained in:
Animesh
2020-10-07 10:27:51 +05:30
parent a98b0f18fc
commit ce247bcab3
3 changed files with 24 additions and 8 deletions
+9
View File
@@ -863,3 +863,12 @@ func newDealInfo(v storagemarket.ClientDeal) api.DealInfo {
func (a *API) ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error {
return a.Retrieval.TryRestartInsufficientFunds(paymentChannel)
}
func (a *API) ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) {
ststr, ok := storagemarket.DealStates[statusCode]
if !ok {
return "", fmt.Errorf("no such deal state %d", statusCode)
}
return ststr, nil
}