lotus icon indicating copy to clipboard operation
lotus copied to clipboard

[BUG] Deal states represented as undocumented integers in json api

Open xloem opened this issue 3 years ago • 0 comments

Describe the bug In the jsonrpc specification at build/openrpc/full.json.gz , the storagemarket.StorageDealStatus State field of DealInfos, are documented as simply number without any information on what different number values mean.

It would be great if either enum deal state values were translated to strings and documented as strings, or the different specific numeric values were documented somewhere in the source, so that code generated from the openrpc spec could be more useful.

Version (run lotus version): v1.9.0

To Reproduce Steps to reproduce the behavior: zcat build/openrpc/full.json.gz | python3 -m json.tool | grep --context=4 '"State": 42' (copying by hand, may have made a typo)

Expected behavior I would like Information on how interpret StorageDealStatus over the json rpc protocol to be apparent in the lotus source tree. I may just need to be referred to documentation.

Additional context This field is defined in go-fil-markets/storagemarket, a separate filecoin project. That project also defines a string mapping, which would be much clearer over json.

xloem avatar Jun 29 '21 14:06 xloem