Skip to content

Commit

Permalink
chore: add github actions and remove travis
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed May 3, 2021
1 parent d8d8a0a commit f03c9c0
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 52 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- run: yarn check-types
- run: yarn lint
test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [14]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
- run: yarn test
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions src/enr/enr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Multiaddr, protocols } from "multiaddr";
import base64url from "base64url";
import { toBigIntBE } from "bigint-buffer";
import * as RLP from "rlp";
import PeerId = require("peer-id");
import muConvert = require("multiaddr/src/convert");
import PeerId from "peer-id";
import muConvert from "multiaddr/src/convert";

import { ERR_INVALID_ID, ERR_NO_SIGNATURE, MAX_RECORD_SIZE } from "./constants";
import * as v4 from "./v4";
Expand Down Expand Up @@ -131,7 +131,7 @@ export class ENR extends Map<ENRKey, ENRValue> {
get tcp(): number | undefined {
const raw = this.get("tcp");
if (raw) {
return muConvert.toString(protocols.names.tcp.code, toNewUint8Array(raw)) as number;
return Number(muConvert.toString(protocols.names.tcp.code, toNewUint8Array(raw)));
} else {
return undefined;
}
Expand All @@ -148,7 +148,7 @@ export class ENR extends Map<ENRKey, ENRValue> {
get udp(): number | undefined {
const raw = this.get("udp");
if (raw) {
return muConvert.toString(protocols.names.udp.code, toNewUint8Array(raw)) as number;
return Number(muConvert.toString(protocols.names.udp.code, toNewUint8Array(raw)));
} else {
return undefined;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ export class ENR extends Map<ENRKey, ENRValue> {
get tcp6(): number | undefined {
const raw = this.get("tcp6");
if (raw) {
return muConvert.toString(protocols.names.tcp.code, raw) as number;
return Number(muConvert.toString(protocols.names.tcp.code, raw));
} else {
return undefined;
}
Expand All @@ -199,7 +199,7 @@ export class ENR extends Map<ENRKey, ENRValue> {
get udp6(): number | undefined {
const raw = this.get("udp6");
if (raw) {
return muConvert.toString(protocols.names.udp.code, raw) as number;
return Number(muConvert.toString(protocols.names.udp.code, raw));
} else {
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/keypair/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PeerId = require("peer-id");
import PeerId from "peer-id";
import { keys } from "libp2p-crypto";
const { keysPBM, supportedKeys } = keys;

Expand Down
2 changes: 1 addition & 1 deletion src/libp2p/discv5.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events";
import PeerId = require("peer-id");
import PeerId from "peer-id";
import { Multiaddr } from "multiaddr";
import { randomBytes } from "libp2p-crypto";

Expand Down
2 changes: 1 addition & 1 deletion src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EventEmitter } from "events";
import debug from "debug";
import { Multiaddr } from "multiaddr";
import isIp = require("is-ip");
import PeerId = require("peer-id");
import PeerId from "peer-id";

import { UDPTransportService } from "../transport";
import { MAX_PACKET_SIZE } from "../packet";
Expand Down
5 changes: 3 additions & 2 deletions types/multiaddr/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

/* eslint-disable @typescript-eslint/no-explicit-any */

declare module "multiaddr/src/ip" {
export function toString(ip: Uint8Array): string;
}

declare module "multiaddr/src/convert" {
export function toString(protocol: any, buf: Uint8Array): string | number;
export function toString(protocol: any, buf: Uint8Array): string;
export function toBytes(protocol: any, str: string | number): Uint8Array;
}
}
15 changes: 5 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea"
integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==

"@types/node@*":
"@types/node@*", "@types/node@>=13.7.0":
version "15.0.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.1.tgz#ef34dea0881028d11398be5bf4e856743e3dc35a"
integrity sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==
Expand All @@ -214,11 +214,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.11.tgz#980832cd56efafff8c18aa148c4085eb02a483f4"
integrity sha512-gema+apZ6qLQK7k7F0dGkGCWQYsL0qqKORWOQO6tq46q+x+1C0vbOiOqOwRVlh4RAdbQwV/j/ryr3u5NOG1fPQ==

"@types/node@^13.7.0":
version "13.13.51"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.51.tgz#a424c5282f99fc1ca41f11b727b6aea80668bcba"
integrity sha512-66/xg5I5Te4oGi5Jws11PtNmKkZbOPZWyBZZ/l5AOrWj1Dyw+6Ge/JhYTq/2/Yvdqyhrue8RL+DGI298OJ0xcg==

"@typescript-eslint/eslint-plugin@^2.7.0":
version "2.34.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz#6f8ce8a46c7dea4a6f1d171d2bb8fbae6dac2be9"
Expand Down Expand Up @@ -2558,9 +2553,9 @@ progress@^2.0.0:
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==

protobufjs@^6.10.2:
version "6.10.2"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b"
integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==
version "6.11.0"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.0.tgz#b890a2d3f64c62f0395e1e000d39ff91634bafb7"
integrity sha512-i4usrGD86mtOLnoTwUsVXphDY7yHM2rDiV3JU4Ix43BOtHi0DHy5rSCciX8MRHSYHaxnoc0TcpwEBlrNUAxvQQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
Expand All @@ -2573,7 +2568,7 @@ protobufjs@^6.10.2:
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" "^13.7.0"
"@types/node" ">=13.7.0"
long "^4.0.0"

pseudomap@^1.0.2:
Expand Down

0 comments on commit f03c9c0

Please sign in to comment.