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

Commit

Permalink
deps: bump protons-runtime from 4.0.2 to 5.0.0 (#49)
Browse files Browse the repository at this point in the history
* 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] <support@github.com>

* 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] <support@github.com>

* chore: regenerate pb defs

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: web3-bot <81333946+web3-bot@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
  • Loading branch information
3 people committed Mar 10, 2023
1 parent 585dc1b commit 48037ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/libp2p-peer-id-factory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/peer-id": "^2.0.0",
"multiformats": "^11.0.0",
"protons-runtime": "^4.0.1",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.0.0",
"uint8arrays": "^4.0.2"
},
"devDependencies": {
"aegir": "^38.1.0",
"protons": "^6.0.0",
"protons": "^7.0.2",
"util": "^0.12.4"
},
"typedoc": {
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-peer-id-factory/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function createFromProtobuf (buf: Uint8Array): Promise<PeerId> {
} = PeerIdProto.decode(buf)

return await createFromParts(
id,
id ?? new Uint8Array(0),
privKey,
pubKey
)
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-peer-id-factory/src/proto.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

message PeerIdProto {
required bytes id = 1;
optional bytes id = 1;
optional bytes pubKey = 2;
optional bytes privKey = 3;
}
13 changes: 6 additions & 7 deletions packages/libp2p-peer-id-factory/src/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
/* eslint-disable complexity */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */

import { encodeMessage, decodeMessage, message } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'
import type { Codec } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'

export interface PeerIdProto {
id: Uint8Array
id?: Uint8Array
pubKey?: Uint8Array
privKey?: Uint8Array
}
Expand All @@ -23,7 +24,7 @@ export namespace PeerIdProto {
w.fork()
}

if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) {
if (obj.id != null) {
w.uint32(10)
w.bytes(obj.id)
}
Expand All @@ -42,9 +43,7 @@ export namespace PeerIdProto {
w.ldelim()
}
}, (reader, length) => {
const obj: any = {
id: new Uint8Array(0)
}
const obj: any = {}

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

Expand Down Expand Up @@ -74,7 +73,7 @@ export namespace PeerIdProto {
return _codec
}

export const encode = (obj: PeerIdProto): Uint8Array => {
export const encode = (obj: Partial<PeerIdProto>): Uint8Array => {
return encodeMessage(obj, PeerIdProto.codec())
}

Expand Down

0 comments on commit 48037ee

Please sign in to comment.