diff --git a/libp2p/protocols/pubsub/rpc/protobuf.nim b/libp2p/protocols/pubsub/rpc/protobuf.nim index c5a3eb309..6ca4ae80e 100644 --- a/libp2p/protocols/pubsub/rpc/protobuf.nim +++ b/libp2p/protocols/pubsub/rpc/protobuf.nim @@ -20,9 +20,19 @@ proc write*(pb: var ProtoBuffer, field: int, graft: ControlGraft) = ipb.finish() pb.write(field, ipb) +proc write*(pb: var ProtoBuffer, field: int, infoMsg: PeerInfoMsg) = + var ipb = initProtoBuffer() + ipb.write(1, infoMsg.peerID) + ipb.write(2, infoMsg.signedPeerRecord) + ipb.finish() + pb.write(field, ipb) + proc write*(pb: var ProtoBuffer, field: int, prune: ControlPrune) = var ipb = initProtoBuffer() ipb.write(1, prune.topicID) + for peer in prune.peers: + ipb.write(2, peer) + ipb.write(3, prune.backoff) ipb.finish() pb.write(field, ipb)