NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 442 forks source link

Type mismatch in Renter API #3135

Closed jkawamoto closed 6 years ago

jkawamoto commented 6 years ago

According to this document, the value of "currentperiod" looks a string, however, Sia daemon v1.3.3 returns it as a number like this:

$ curl -s -H "User-Agent:Sia-Agent" http://localhost:9980/renter | jq .
{
  "settings": {
    "allowance": {
      "funds": "8119111750262431730364430380",
      "hosts": 90,
      "period": 12960,
      "renewwindow": 2160
    },
    "maxuploadspeed": 0,
    "maxdownloadspeed": 0,
    "streamcachesize": 2
  },
  "financialmetrics": {
    "contractfees": "529714582534027464540630000",
    "downloadspending": "0",
    "storagespending": "0",
    "totalallocated": "2766512151941273034050102132",
    "uploadspending": "0",
    "unspent": "7589397167728404265823800380",
    "contractspending": "2766512151941273034050102132"
  },
  "currentperiod": 160779
}

Environment

lukechampine commented 6 years ago

Good catch. The docs should treat it as a number. Do you mind submitting a PR to remove the quotation marks in the docs? You can do it really quickly using the GitHub editor interface.

jkawamoto commented 6 years ago

Sure.