Skip to content

Commit

Permalink
Fix #2962 (#2964)
Browse files Browse the repository at this point in the history
Fix #2962

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
tomaka and mergify[bot] authored Nov 4, 2022
1 parent 5aeebfd commit e381753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed

- On NodeJS, the usage of `hrtime` has been replaced with `performance.now()`. While this doesn't change anything for NodeJS users, Deno users that were importing smoldot through the <https://esm.sh> website will no longer get an error due to Deno's compatibility layer not supporting `hrtime`. As a reminder, smoldot is also published on the Deno/x registry and using <https://esm.sh> is unnecessary. ([#2964](https://github.com/paritytech/smoldot/pull/2964))
- Fix the `ext_crypto_ecdsa_verify_version_1` and `ext_crypto_ecdsa_verify_prehashed_version_1` host functions mixing their parameters and thus always failing. ([#2955](https://github.com/paritytech/smoldot/pull/2955))

## 0.7.5 - 2022-10-31
Expand Down
5 changes: 2 additions & 3 deletions bin/wasm-node/javascript/src/index-nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Connection, ConnectionError, ConnectionConfig } from './instance/instan
import { WebSocket } from 'ws';
import { inflate } from 'pako';

import { hrtime } from 'node:process';
import { performance } from 'node:perf_hooks';
import { createConnection as nodeCreateConnection } from 'node:net';
import type { Socket as TcpSocket } from 'node:net';
import { randomFillSync } from 'node:crypto';
Expand Down Expand Up @@ -59,8 +59,7 @@ export function start(options?: ClientOptions): Client {
return Promise.resolve(inflate(Buffer.from(input, 'base64')))
},
performanceNow: () => {
const time = hrtime();
return ((time[0] * 1e3) + (time[1] / 1e6));
return performance.now()
},
getRandomValues: (buffer) => {
if (buffer.length >= 65536)
Expand Down

0 comments on commit e381753

Please sign in to comment.