Skip to content

Commit

Permalink
fix: unblock strict no sign messages (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Jun 29, 2022
1 parent 8486c39 commit 9e964cc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,13 +1002,9 @@ export class GossipSub extends EventEmitter<GossipsubEvents> implements Initiali
return { code: MessageStatus.invalid, reason: RejectReason.Error, error: ValidateError.TransformFailed }
}

if (rpcMsg.from == null) {
this.log('Invalid message, transform failed')
return { code: MessageStatus.invalid, reason: RejectReason.Error, error: ValidateError.TransformFailed }
}

const msg: Message = {
from: peerIdFromBytes(rpcMsg.from),
// TODO fix types upstream, see https://github.com/libp2p/js-libp2p-interfaces/pull/266
from: (rpcMsg.from == null ? undefined : peerIdFromBytes(rpcMsg.from)) as PeerId,
data: data,
sequenceNumber: rpcMsg.seqno == null ? undefined : BigInt(`0x${uint8ArrayToString(rpcMsg.seqno, 'base16')}`),
topic: rpcMsg.topic
Expand Down

0 comments on commit 9e964cc

Please sign in to comment.