File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 22
33- Update to ` libp2p-swarm ` ` v0.39.0 ` .
44
5+ - Allow publishing with any ` impl Into<TopicHash> ` as a topic. See [ PR 2862] .
6+
7+ [ PR 2862 ] : https://github.com/libp2p/rust-libp2p/pull/2862
8+
59# 0.40.0
610
711- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
Original file line number Diff line number Diff line change @@ -587,19 +587,20 @@ where
587587 }
588588
589589 /// Publishes a message with multiple topics to the network.
590- pub fn publish < H : Hasher > (
590+ pub fn publish (
591591 & mut self ,
592- topic : Topic < H > ,
592+ topic : impl Into < TopicHash > ,
593593 data : impl Into < Vec < u8 > > ,
594594 ) -> Result < MessageId , PublishError > {
595595 let data = data. into ( ) ;
596+ let topic = topic. into ( ) ;
596597
597598 // Transform the data before building a raw_message.
598599 let transformed_data = self
599600 . data_transform
600- . outbound_transform ( & topic. hash ( ) , data. clone ( ) ) ?;
601+ . outbound_transform ( & topic, data. clone ( ) ) ?;
601602
602- let raw_message = self . build_raw_message ( topic. into ( ) , transformed_data) ?;
603+ let raw_message = self . build_raw_message ( topic, transformed_data) ?;
603604
604605 // calculate the message id from the un-transformed data
605606 let msg_id = self . config . message_id ( & GossipsubMessage {
You can’t perform that action at this time.
0 commit comments