You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why do you use Message in floodsub::lib when it differs from floodsub::rpc_proto::Message?
floodsub::lib:
/// A message received by the floodsub system.#[derive(Debug,Clone,PartialEq,Eq,Hash)]pubstructMessage{/// Remote that sent the message.pubsource:Multiaddr,/// Content of the message. Its meaning is out of scope of this library.pubdata:Vec<u8>,/// List of topics of this message.////// Each message can belong to multiple topics at once.pubtopics:Vec<TopicHash>,}
floodsub::rpc_proto::Message:
#[derive(PartialEq,Clone,Default)]pubstructMessage{// message fieldsfrom:::protobuf::SingularField<::std::vec::Vec<u8>>,data:::protobuf::SingularField<::std::vec::Vec<u8>>,seqno:::protobuf::SingularField<::std::vec::Vec<u8>>,topicIDs:::protobuf::RepeatedField<::std::string::String>,// special fieldsunknown_fields:::protobuf::UnknownFields,cached_size:::protobuf::CachedSize,}
The text was updated successfully, but these errors were encountered:
jamesray1
changed the title
Why do you use Message in floodsub::lib when it differs from floodsub::rpc_proto::Message?
floodsub::lib::Message vs floodsub::rpc_proto::Message
Sep 25, 2018
We don't expose the message struct of the protobuf library because we don't want users to have to be aware of the fact that we use this library as part of the implementation.
By doing so, we can replace protobuf with something else if necessary, without having to modify the Message struct. And therefore the users of floodsub also will not need to make any adjustement.
Why do you use
Message
infloodsub::lib
when it differs fromfloodsub::rpc_proto::Message
?floodsub::lib
:floodsub::rpc_proto::Message
:Related: #473.
The text was updated successfully, but these errors were encountered: