bcash icon indicating copy to clipboard operation
bcash copied to clipboard

rpc: add uptime

Open slashrsm opened this issue 6 years ago • 2 comments

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.

slashrsm avatar Aug 14 '18 22:08 slashrsm

Also see here:

http://bcoin.io/api-docs/index.html#get-server-info

curl $url | jq .time.uptime

tynes avatar Aug 14 '18 23:08 tynes

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.

slashrsm avatar Aug 16 '18 08:08 slashrsm