MCPcopy
hub / github.com/mongodb/node-mongodb-native / genClusterTime

Function genClusterTime

test/tools/common.js:121–126  ·  view source on GitHub ↗

* Creates a cluster time for use in unit testing cluster time gossiping and * causal consistency. * * @param {number} time the logical time * @returns a cluster time according to the driver sessions specification

(time)

Source from the content-addressed store, hash-verified

119 * @returns a cluster time according to the driver sessions specification
120 */
121function genClusterTime(time) {
122 return {
123 clusterTime: new Timestamp(Long.fromNumber(time, true)),
124 signature: { hash: new Binary(Buffer.from('test', 'utf8')), keyId: new Long(1) }
125 };
126}
127
128module.exports = {
129 ReplSetFixture: ReplSetFixture,

Callers 2

sessions.test.tsFile · 0.90
connect.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected