/// The function converts a `ConsensusMessage` into an advert for a
/// `ConsensusArtifact`.
The function converts a `ConsensusMessage` into an advert for a
`ConsensusArtifact`.
The function converts a ` ConsensusMessage ` into an advert for a ` ConsensusArtifact ` .
fn message_to_advert(msg: &ConsensusMessage) -> Advert<ConsensusArtifact> {
        let binary_data = bincode::serialize(msg).unwrap();
        let attribute = ConsensusMessageAttribute::from(msg);
        let size = binary_data.len();
        Advert {
            id: msg.get_id(),
            attribute,
            size,
            integrity_hash: ic_crypto::crypto_hash(msg).get(),
        }
    }
fn message_to_advert ( msg : & ConsensusMessage ) -> Advert < ConsensusArtifact > { let binary_data = bincode :: serialize ( msg ) . unwrap ( ) ; let attribute = ConsensusMessageAttribute :: from ( msg ) ; let size = binary_data . len ( ) ; Advert { id : msg . get_id ( ) , attribute , size , integrity_hash : ic_crypto :: crypto_hash ( msg ) . get ( ) , } }
The function converts a `ConsensusMessage` into an advert for a
`ConsensusArtifact`.
The function converts a ` ConsensusMessage ` into an advert for a ` ConsensusArtifact ` .
msg
&ConsensusMessage