Skip to content

Commit

Permalink
deps(dev): bump protons from 6.1.3 to 7.0.2 (#124)
Browse files Browse the repository at this point in the history
* deps(dev): 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:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* 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 proto

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
  • Loading branch information
dependabot[bot] and achingbrain authored Feb 22, 2023
1 parent 0a30cf6 commit 302763e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@
"it-pair": "^2.0.2",
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"protons": "^6.0.0",
"protons-runtime": "^4.0.1",
"protons": "^7.0.2",
"protons-runtime": "^5.0.0",
"sinon": "^15.0.1",
"util": "^0.12.4"
}
Expand Down
53 changes: 19 additions & 34 deletions test/message/rpc.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 RPC {
subscriptions: RPC.SubOpts[]
Expand Down Expand Up @@ -70,7 +71,7 @@ export namespace RPC {
return _codec
}

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

Expand Down Expand Up @@ -171,7 +172,7 @@ export namespace RPC {
return _codec
}

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

Expand All @@ -192,26 +193,20 @@ export namespace RPC {
if (obj.subscriptions != null) {
for (const value of obj.subscriptions) {
w.uint32(10)
RPC.SubOpts.codec().encode(value, w, {
writeDefaults: true
})
RPC.SubOpts.codec().encode(value, w)
}
}

if (obj.messages != null) {
for (const value of obj.messages) {
w.uint32(18)
RPC.Message.codec().encode(value, w, {
writeDefaults: true
})
RPC.Message.codec().encode(value, w)
}
}

if (obj.control != null) {
w.uint32(26)
ControlMessage.codec().encode(obj.control, w, {
writeDefaults: false
})
ControlMessage.codec().encode(obj.control, w)
}

if (opts.lengthDelimited !== false) {
Expand Down Expand Up @@ -251,7 +246,7 @@ export namespace RPC {
return _codec
}

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

Expand Down Expand Up @@ -280,36 +275,28 @@ export namespace ControlMessage {
if (obj.ihave != null) {
for (const value of obj.ihave) {
w.uint32(10)
ControlIHave.codec().encode(value, w, {
writeDefaults: true
})
ControlIHave.codec().encode(value, w)
}
}

if (obj.iwant != null) {
for (const value of obj.iwant) {
w.uint32(18)
ControlIWant.codec().encode(value, w, {
writeDefaults: true
})
ControlIWant.codec().encode(value, w)
}
}

if (obj.graft != null) {
for (const value of obj.graft) {
w.uint32(26)
ControlGraft.codec().encode(value, w, {
writeDefaults: true
})
ControlGraft.codec().encode(value, w)
}
}

if (obj.prune != null) {
for (const value of obj.prune) {
w.uint32(34)
ControlPrune.codec().encode(value, w, {
writeDefaults: true
})
ControlPrune.codec().encode(value, w)
}
}

Expand Down Expand Up @@ -355,7 +342,7 @@ export namespace ControlMessage {
return _codec
}

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

Expand Down Expand Up @@ -424,7 +411,7 @@ export namespace ControlIHave {
return _codec
}

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

Expand Down Expand Up @@ -484,7 +471,7 @@ export namespace ControlIWant {
return _codec
}

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

Expand Down Expand Up @@ -540,7 +527,7 @@ export namespace ControlGraft {
return _codec
}

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

Expand Down Expand Up @@ -573,9 +560,7 @@ export namespace ControlPrune {
if (obj.peers != null) {
for (const value of obj.peers) {
w.uint32(18)
PeerInfo.codec().encode(value, w, {
writeDefaults: true
})
PeerInfo.codec().encode(value, w)
}
}

Expand Down Expand Up @@ -620,7 +605,7 @@ export namespace ControlPrune {
return _codec
}

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

Expand Down Expand Up @@ -685,7 +670,7 @@ export namespace PeerInfo {
return _codec
}

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

Expand Down

0 comments on commit 302763e

Please sign in to comment.