From 1c5e5b6cb95a98ffc5177d09c0c8252435f42b00 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Mon, 12 Apr 2021 09:30:50 +0200 Subject: [PATCH 1/3] fix: build --- .github/workflows/main.yml | 1 + package.json | 1 + src/index.js | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ef53e8..217782d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ jobs: - run: npm install - run: npx aegir lint - run: npx aegir dep-check + - run: npx aegir build test-node: needs: check runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index e5179eb..9ba9bef 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "main": "src/index.js", "scripts": { "lint": "aegir lint", + "build": "aegir build", "test": "aegir test", "test:node": "aegir test -t node", "test:browser": "aegir test -t browser", diff --git a/src/index.js b/src/index.js index 6486eaa..a49ab08 100644 --- a/src/index.js +++ b/src/index.js @@ -60,8 +60,14 @@ class Bootstrap extends EventEmitter { } const ma = new Multiaddr(candidate) + const peerIdStr = ma.getPeerId() - const peerId = PeerId.createFromB58String(ma.getPeerId()) + if (!peerIdStr) { + log.error('Invalid bootstrap multiaddr without peer id') + return + } + + const peerId = PeerId.createFromB58String(peerIdStr) try { this.emit('peer', { From e4ff39ca34d4d31e458c14f0a914c6558b442ed4 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Mon, 12 Apr 2021 14:34:57 +0200 Subject: [PATCH 2/3] chore: use firefox in CI --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 217782d..5044565 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,4 +45,4 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless \ No newline at end of file + - run: npx aegir test -t browser -t webworker --bail -- --browser firefox \ No newline at end of file From b2b5fad38018f9fd6141d9e40ee98a1f40605f07 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Mon, 12 Apr 2021 14:59:45 +0200 Subject: [PATCH 3/3] chore: replace codecov in ci --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5044565..d16cfb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: with: node-version: ${{ matrix.node }} - run: npm install - - run: npx nyc --reporter=lcov aegir test -t node -- --bail + - run: npx aegir test -t node --bail --cov - uses: codecov/codecov-action@v1 test-chrome: needs: check