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

Commit

Permalink
deps(dev): bump protons from 6.1.3 to 7.0.2 (#60)
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] <[email protected]>

* 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 protobuf files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <[email protected]>
  • Loading branch information
dependabot[bot] and achingbrain authored Mar 2, 2023
1 parent e1271cf commit 0b5e25f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"it-pipe": "^2.0.3",
"mortice": "^3.0.0",
"multiformats": "^11.0.0",
"protons-runtime": "^4.0.1",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.1.1",
"uint8arrays": "^4.0.2"
},
Expand All @@ -174,7 +174,7 @@
"delay": "^5.0.0",
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"protons": "^6.0.0",
"protons": "^7.0.2",
"sinon": "^15.0.1"
}
}
23 changes: 10 additions & 13 deletions src/pb/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
/* 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 Peer {
addresses: Address[]
Expand All @@ -28,9 +29,7 @@ export namespace Peer {
if (obj.addresses != null) {
for (const value of obj.addresses) {
w.uint32(10)
Address.codec().encode(value, w, {
writeDefaults: true
})
Address.codec().encode(value, w)
}
}

Expand All @@ -44,9 +43,7 @@ export namespace Peer {
if (obj.metadata != null) {
for (const value of obj.metadata) {
w.uint32(26)
Metadata.codec().encode(value, w, {
writeDefaults: true
})
Metadata.codec().encode(value, w)
}
}

Expand Down Expand Up @@ -104,7 +101,7 @@ export namespace Peer {
return _codec
}

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

Expand All @@ -128,7 +125,7 @@ export namespace Address {
w.fork()
}

if (opts.writeDefaults === true || (obj.multiaddr != null && obj.multiaddr.byteLength > 0)) {
if ((obj.multiaddr != null && obj.multiaddr.byteLength > 0)) {
w.uint32(10)
w.bytes(obj.multiaddr)
}
Expand Down Expand Up @@ -171,7 +168,7 @@ export namespace Address {
return _codec
}

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

Expand All @@ -195,12 +192,12 @@ export namespace Metadata {
w.fork()
}

if (opts.writeDefaults === true || obj.key !== '') {
if ((obj.key != null && obj.key !== '')) {
w.uint32(10)
w.string(obj.key)
}

if (opts.writeDefaults === true || (obj.value != null && obj.value.byteLength > 0)) {
if ((obj.value != null && obj.value.byteLength > 0)) {
w.uint32(18)
w.bytes(obj.value)
}
Expand Down Expand Up @@ -239,7 +236,7 @@ export namespace Metadata {
return _codec
}

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

Expand Down
13 changes: 6 additions & 7 deletions src/pb/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
/* 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 Tags {
tags: Tag[]
Expand All @@ -24,9 +25,7 @@ export namespace Tags {
if (obj.tags != null) {
for (const value of obj.tags) {
w.uint32(10)
Tag.codec().encode(value, w, {
writeDefaults: true
})
Tag.codec().encode(value, w)
}
}

Expand Down Expand Up @@ -60,7 +59,7 @@ export namespace Tags {
return _codec
}

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

Expand All @@ -85,7 +84,7 @@ export namespace Tag {
w.fork()
}

if (opts.writeDefaults === true || obj.name !== '') {
if ((obj.name != null && obj.name !== '')) {
w.uint32(10)
w.string(obj.name)
}
Expand Down Expand Up @@ -136,7 +135,7 @@ export namespace Tag {
return _codec
}

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

Expand Down

0 comments on commit 0b5e25f

Please sign in to comment.