Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 48037ee

Browse files
dependabot[bot]web3-botachingbrain
authored
deps: bump protons-runtime from 4.0.2 to 5.0.0 (#49)
* deps: bump protons-runtime from 4.0.2 to 5.0.0 Bumps [protons-runtime](https://github.com/ipfs/protons) from 4.0.2 to 5.0.0. - [Release notes](https://github.com/ipfs/protons/releases) - [Commits](ipfs/protons@protons-runtime-v4.0.2...protons-runtime-v5.0.0) --- updated-dependencies: - dependency-name: protons-runtime dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * update .github/workflows/js-test-and-release.yml (#51) * update .github/workflows/js-test-and-release.yml (#52) * deps(dev): bump protons from 6.1.3 to 7.0.2 Bumps [protons](https://github.com/ipfs/protons) from 6.1.3 to 7.0.2. - [Release notes](https://github.com/ipfs/protons/releases) - [Commits](ipfs/protons@protons-v6.1.3...protons-v7.0.2) --- updated-dependencies: - dependency-name: protons dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: regenerate pb defs --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: web3-bot <[email protected]> Co-authored-by: achingbrain <[email protected]>
1 parent 585dc1b commit 48037ee

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

packages/libp2p-peer-id-factory/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@
147147
"@libp2p/interface-peer-id": "^2.0.0",
148148
"@libp2p/peer-id": "^2.0.0",
149149
"multiformats": "^11.0.0",
150-
"protons-runtime": "^4.0.1",
150+
"protons-runtime": "^5.0.0",
151151
"uint8arraylist": "^2.0.0",
152152
"uint8arrays": "^4.0.2"
153153
},
154154
"devDependencies": {
155155
"aegir": "^38.1.0",
156-
"protons": "^6.0.0",
156+
"protons": "^7.0.2",
157157
"util": "^0.12.4"
158158
},
159159
"typedoc": {

packages/libp2p-peer-id-factory/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function createFromProtobuf (buf: Uint8Array): Promise<PeerId> {
6262
} = PeerIdProto.decode(buf)
6363

6464
return await createFromParts(
65-
id,
65+
id ?? new Uint8Array(0),
6666
privKey,
6767
pubKey
6868
)
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
syntax = "proto3";
22

33
message PeerIdProto {
4-
required bytes id = 1;
4+
optional bytes id = 1;
55
optional bytes pubKey = 2;
66
optional bytes privKey = 3;
77
}

packages/libp2p-peer-id-factory/src/proto.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
/* eslint-disable complexity */
33
/* eslint-disable @typescript-eslint/no-namespace */
44
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
5+
/* eslint-disable @typescript-eslint/no-empty-interface */
56

67
import { encodeMessage, decodeMessage, message } from 'protons-runtime'
7-
import type { Uint8ArrayList } from 'uint8arraylist'
88
import type { Codec } from 'protons-runtime'
9+
import type { Uint8ArrayList } from 'uint8arraylist'
910

1011
export interface PeerIdProto {
11-
id: Uint8Array
12+
id?: Uint8Array
1213
pubKey?: Uint8Array
1314
privKey?: Uint8Array
1415
}
@@ -23,7 +24,7 @@ export namespace PeerIdProto {
2324
w.fork()
2425
}
2526

26-
if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) {
27+
if (obj.id != null) {
2728
w.uint32(10)
2829
w.bytes(obj.id)
2930
}
@@ -42,9 +43,7 @@ export namespace PeerIdProto {
4243
w.ldelim()
4344
}
4445
}, (reader, length) => {
45-
const obj: any = {
46-
id: new Uint8Array(0)
47-
}
46+
const obj: any = {}
4847

4948
const end = length == null ? reader.len : reader.pos + length
5049

@@ -74,7 +73,7 @@ export namespace PeerIdProto {
7473
return _codec
7574
}
7675

77-
export const encode = (obj: PeerIdProto): Uint8Array => {
76+
export const encode = (obj: Partial<PeerIdProto>): Uint8Array => {
7877
return encodeMessage(obj, PeerIdProto.codec())
7978
}
8079

0 commit comments

Comments
 (0)