bcash
bcash copied to clipboard
rpc: add uptime
Fixes #51.
I am playing with bcash and thought that this issue would be a nice intro into the codebase.
Depends on the related pull bcoin-org/bclient#14 to pass the test.
Also see here:
http://bcoin.io/api-docs/index.html#get-server-info
curl $url | jq .time.uptime
Thank you for the feedback! I understand the concern about adding an additional dependency. Uptime seems to always be 0
in the test environment. We could simply assert for that to make sure that something sensible is returned or mock the date on our own (it looks failry simple to do so...).
Uptime isn't covered by the test that covers the server info request. Date mock could also benefit that and other time-related stuff I guess.