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

Commit

Permalink
deps: bump uint8arrays, protons and multiformats (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Oct 12, 2022
1 parent 71da9d9 commit e270265
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
8 changes: 4 additions & 4 deletions packages/libp2p-peer-id-factory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@
"@libp2p/interface-keys": "^1.0.2",
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/peer-id": "^1.0.0",
"multiformats": "^9.6.3",
"protons-runtime": "^3.1.0",
"multiformats": "^10.0.0",
"protons-runtime": "^4.0.1",
"uint8arraylist": "^2.0.0",
"uint8arrays": "^3.0.0"
"uint8arrays": "^4.0.2"
},
"devDependencies": {
"aegir": "^37.0.7",
"protons": "^5.1.0",
"protons": "^6.0.0",
"util": "^0.12.4"
}
}
28 changes: 12 additions & 16 deletions packages/libp2p-peer-id-factory/src/proto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable import/export */
/* eslint-disable complexity */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */

import { encodeMessage, decodeMessage, message } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'
Expand All @@ -16,30 +18,28 @@ export namespace PeerIdProto {

export const codec = (): Codec<PeerIdProto> => {
if (_codec == null) {
_codec = message<PeerIdProto>((obj, writer, opts = {}) => {
_codec = message<PeerIdProto>((obj, w, opts = {}) => {
if (opts.lengthDelimited !== false) {
writer.fork()
w.fork()
}

if (obj.id != null) {
writer.uint32(10)
writer.bytes(obj.id)
} else {
throw new Error('Protocol error: required field "id" was not found in object')
if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) {
w.uint32(10)
w.bytes(obj.id)
}

if (obj.pubKey != null) {
writer.uint32(18)
writer.bytes(obj.pubKey)
w.uint32(18)
w.bytes(obj.pubKey)
}

if (obj.privKey != null) {
writer.uint32(26)
writer.bytes(obj.privKey)
w.uint32(26)
w.bytes(obj.privKey)
}

if (opts.lengthDelimited !== false) {
writer.ldelim()
w.ldelim()
}
}, (reader, length) => {
const obj: any = {
Expand Down Expand Up @@ -67,10 +67,6 @@ export namespace PeerIdProto {
}
}

if (obj.id == null) {
throw new Error('Protocol error: value for required field "id" was not found in protobuf')
}

return obj
})
}
Expand Down
4 changes: 2 additions & 2 deletions packages/libp2p-peer-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
"dependencies": {
"@libp2p/interface-peer-id": "^1.0.0",
"err-code": "^3.0.1",
"multiformats": "^9.6.3",
"uint8arrays": "^3.0.0"
"multiformats": "^10.0.0",
"uint8arrays": "^4.0.2"
},
"devDependencies": {
"aegir": "^37.0.7"
Expand Down

0 comments on commit e270265

Please sign in to comment.