gctrpc: endpoints now optionally return timestamps in nanoseconds (configurable) (#718)

* config: add remoteControl/gRPC/timeInNanoSeconds

* grpc: consult with remoteControl/gRPC/timeInNanoSeconds whether timestamps should be in seconds or nanos

* engine: test if RPCServer.unixTimestamp() respects config/remoteControl/gRPC/timeInNanoSeconds

* engine: implement TestRPCServer_GetTicker_LastUpdatedNanos that makes sure TickerResponse.LastUpdated is returned in nanoseconds if configured

* config_example.json: add remoteControl/gRPC/timeInNanoSeconds

* engine: (1) test RPCServer.unixTimestamp() in parallel, (2) increase time tolerance of TestRPCServer_GetTicker_LastUpdatedNanos()

* engine: TestRPCServer_GetTicker_LastUpdatedNanos() now fetches a mock-up ticker to check timestamps
This commit is contained in:
Yordan Miladinov
2021-07-28 02:22:20 +03:00
committed by GitHub
parent b5aa3eddb2
commit 4d9a49e7f7
4 changed files with 124 additions and 19 deletions

View File

@@ -183,7 +183,8 @@
"enabled": true,
"listenAddress": "localhost:9052",
"grpcProxyEnabled": false,
"grpcProxyListenAddress": "localhost:9053"
"grpcProxyListenAddress": "localhost:9053",
"timeInNanoSeconds": false
},
"deprecatedRPC": {
"enabled": true,
@@ -2451,4 +2452,4 @@
"supportedExchanges": "Kraken,Bitstamp"
}
]
}
}