Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

chore: support node 18 #2988

Merged
merged 12 commits into from
Apr 29, 2022
6 changes: 5 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12.0.0, 12.x, 14.x, 16.x, 17.x]
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
os: [windows-2019, ubuntu-18.04, ubuntu-20.04, macos-11]
exclude:
# Node v18 does not run on ubuntu-18.04: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442
- os: ubuntu-18.04
node: 18.x

runs-on: ${{ matrix.os }}

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12.0.0, 12.x, 14.x, 16.x, 17.x]
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
os: [ubuntu-20.04]

runs-on: ${{ matrix.os }}
Expand All @@ -34,8 +34,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12.0.0, 12.x, 14.x, 16.x, 17.x]
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
os: [windows-2019, ubuntu-18.04, ubuntu-20.04, macos-11]
exclude:
# Node v18 does not run on ubuntu-18.04: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442
- os: ubuntu-18.04
node: 18.x

runs-on: ${{ matrix.os }}

Expand Down
6 changes: 3 additions & 3 deletions src/chains/ethereum/ethereum/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/ethereum/ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"ws": "8.2.3"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.5",
"@trufflesuite/uws-js-unofficial": "20.8.0-unofficial.0",
"@types/encoding-down": "5.0.0",
"@types/fs-extra": "9.0.2",
"@types/keccak": "3.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/chains/filecoin/filecoin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/filecoin/filecoin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@filecoin-shipyard/lotus-client-schema": "2.0.0",
"@ganache/filecoin-options": "0.2.0",
"@ganache/utils": "0.2.0",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.5",
"@trufflesuite/uws-js-unofficial": "20.8.0-unofficial.0",
"@types/bn.js": "5.1.0",
"@types/deep-equal": "1.0.1",
"@types/levelup": "4.3.0",
Expand Down
6 changes: 3 additions & 3 deletions src/chains/tezos/tezos/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chains/tezos/tezos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"emittery": "0.10.0"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.5",
"@trufflesuite/uws-js-unofficial": "20.8.0-unofficial.0",
"@types/mocha": "9.0.0",
"cheerio": "1.0.0-rc.3",
"cross-env": "7.0.3",
Expand Down
6 changes: 3 additions & 3 deletions src/packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@ganache/options": "0.2.0",
"@ganache/tezos": "0.2.0",
"@ganache/utils": "0.2.0",
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.5",
"@trufflesuite/uws-js-unofficial": "20.8.0-unofficial.0",
"aggregate-error": "3.1.0",
"emittery": "0.10.0",
"promise.allsettled": "1.0.4"
Expand Down
16 changes: 14 additions & 2 deletions src/packages/core/tests/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import { PromiEvent } from "@ganache/utils";
import { promisify } from "util";
import { ServerOptions } from "../src/options";
import { Connector, Provider as EthereumProvider } from "@ganache/ethereum";
import { NetworkInterfaceInfo, networkInterfaces } from 'os';
import {
NetworkInterfaceInfo,
NetworkInterfaceInfoIPv6,
networkInterfaces
} from "os";

const IS_WINDOWS = process.platform === "win32";

Expand Down Expand Up @@ -112,9 +116,17 @@ describe("server", () => {
// machines are unpredictible and may behave in ways that we don't care
// about.
(process.env.GITHUB_ACTION ? describe : describe.skip)("listen", function () {
function isIPv6(
info: NetworkInterfaceInfo
): info is NetworkInterfaceInfoIPv6 {
// Node v18.0.0+ uses info.family = 6, all versions prior to v18 use "IPv6"
// @ts-ignore
return info.family === "IPv6" || info.family === 6;
}

function getHost(info: NetworkInterfaceInfo, interfaceName: string) {
// a link-local ipv6 address starts with fe80:: and _must_ include a "zone_id"
if (info.family === "IPv6" && info.address.startsWith("fe80::")) {
if (isIPv6(info) && info.address.startsWith("fe80::")) {
if (process.platform == "win32") {
// on windows the zone_id is the scopeid
return `${info.address}%${info.scopeid}`;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/ganache/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/packages/utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"seedrandom": "3.0.5"
},
"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.4.0-unofficial.5",
"@trufflesuite/uws-js-unofficial": "20.8.0-unofficial.0",
"@types/mocha": "9.0.0",
"@types/seedrandom": "3.0.1",
"cross-env": "7.0.3",
Expand Down