97: Upgrade libp2p packages r=D4nte a=D4nte



Co-authored-by: Franck Royer <franck@status.im>
This commit is contained in:
bors[bot] 2021-04-29 03:33:45 +00:00 committed by GitHub
commit 2f03daa9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 5674 additions and 2020 deletions

View File

@ -1,9 +0,0 @@
const {defaults} = require('jest-config');
module.exports = {
testEnvironment: 'node',
moduleFileExtensions: [...defaults.moduleFileExtensions, 'd.ts'],
testTimeout: 10_000,
roots: [
'<rootDir>/build/main' // testing javascript output due to type issues with protobuf. TODO: try out ts-proto
]
};

1509
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -52,19 +52,19 @@
"dependencies": {
"@bitauth/libauth": "^1.17.1",
"debug": "^4.3.1",
"it-concat": "^1.0.3",
"it-length-prefixed": "^3.1.0",
"libp2p": "^0.31.0-rc.3",
"libp2p-gossipsub": "^0.7.0",
"libp2p-mplex": "^0.10.2",
"libp2p-noise": "^2.0.5",
"it-concat": "^2.0.0",
"it-length-prefixed": "^5.0.2",
"libp2p": "^0.31.0",
"libp2p-gossipsub": "^0.9.0",
"libp2p-mplex": "^0.10.3",
"libp2p-noise": "^3.0.0",
"libp2p-secio": "^0.13.1",
"libp2p-tcp": "^0.15.3",
"libp2p-websockets": "^0.15.5",
"libp2p-tcp": "^0.15.4",
"libp2p-websockets": "^0.15.6",
"multiaddr": "^9.0.1",
"prompt-sync": "^4.2.0",
"ts-proto": "^1.79.3",
"uuid": "^3.4.0",
"ts-proto": "^1.79.7",
"uuid": "^8.3.2",
"yarg": "^1.0.8"
},
"devDependencies": {

View File

@ -1,11 +1,8 @@
import Libp2p from 'libp2p';
import Gossipsub from 'libp2p-gossipsub';
import {
AddrInfo,
Libp2p,
MessageIdFunction,
} from 'libp2p-gossipsub/src/interfaces';
import { ControlPrune, PeerInfo } from 'libp2p-gossipsub/src/message';
import { AddrInfo, MessageIdFunction } from 'libp2p-gossipsub/src/interfaces';
import { MessageCache } from 'libp2p-gossipsub/src/message-cache';
import { RPC } from 'libp2p-gossipsub/src/message/rpc';
import {
PeerScoreParams,
PeerScoreThresholds,
@ -307,13 +304,13 @@ export class WakuRelay extends Gossipsub {
* @param {string} id
* @param {string} topic
* @param {boolean} doPX
* @returns {ControlPrune}
* @returns {RPC.IControlPrune}
*/
_makePrune(id: string, topic: string, doPX: boolean): ControlPrune {
_makePrune(id: string, topic: string, doPX: boolean): RPC.IControlPrune {
// backoff is measured in seconds
// RelayPruneBackoff is measured in milliseconds
const backoff = constants.RelayPruneBackoff / 1000;
const px: PeerInfo[] = [];
const px: RPC.IPeerInfo[] = [];
if (doPX) {
// select peers for Peer eXchange
const peers = getRelayPeers(

View File

@ -138,7 +138,14 @@ function base64FromBytes(arr: Uint8Array): string {
return btoa(bin.join(''));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -156,7 +156,14 @@ function base64FromBytes(arr: Uint8Array): string {
return btoa(bin.join(''));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -649,7 +649,14 @@ function base64FromBytes(arr: Uint8Array): string {
return btoa(bin.join(''));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,14 @@
"homepage": "/js-waku",
"dependencies": {
"@material-ui/core": "^4.11.3",
"peer-id": "^0.14.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"waku": "file:../build/main/lib",
"waku-chat": "file:../build/main/chat",
"web-vitals": "^1.1.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^12.8.3",
@ -12,14 +20,12 @@
"@types/node": "^12.20.7",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"peer-id": "^0.14.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"cspell": "^5.3.12",
"gh-pages": "^3.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"react-scripts": "4.0.3",
"typescript": "^4.2.4",
"waku": "file:../build/main/lib",
"waku-chat": "file:../build/main/chat",
"web-vitals": "^1.1.1"
"typescript": "^4.2.4"
},
"scripts": {
"start": "react-scripts start",
@ -54,11 +60,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"cspell": "^5.3.12",
"gh-pages": "^3.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1"
}
}