Skip to content

Commit

Permalink
fix: make pubsub message types consistent (#4145)
Browse files Browse the repository at this point in the history
From field should be a peer id as per the types.
  • Loading branch information
achingbrain authored Jun 24, 2022
1 parent 3c52cb0 commit 010427b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pubsub/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { logger } from '@libp2p/logger'
import { configure } from '../lib/configure.js'
import { toUrlSearchParams } from '../lib/to-url-search-params.js'
import { textToUrlSafeRpc, rpcToText, rpcToBytes, rpcToBigInt } from '../lib/http-rpc-wire-format.js'
import { peerIdFromString } from '@libp2p/peer-id'
const log = logger('ipfs-http-client:pubsub:subscribe')

/**
Expand Down Expand Up @@ -107,7 +108,7 @@ async function readMessages (response, { onMessage, onEnd, onError }) {
}

onMessage({
from: msg.from,
from: peerIdFromString(msg.from),
data: rpcToBytes(msg.data),
sequenceNumber: rpcToBigInt(msg.seqno),
topic: rpcToText(msg.topicIDs[0])
Expand Down

0 comments on commit 010427b

Please sign in to comment.