pub async fn promote_unchecked(&self, message_id: &MessageId) -> Result<(MessageId, Message)> {
        // Create a new message (zero value message) for which one tip would be the actual message
        let mut tips = self.get_tips().await?;
        let min_pow_score = self.get_min_pow_score().await?;
        let network_id = self.get_network_id().await?;
        tips.push(*message_id);
        // Sort tips/parents
        tips.sort_unstable_by_key(|a| a.pack_new());
        tips.dedup();

        let promote_message = MessageBuilder::<ClientMiner>::new()
            .with_network_id(network_id)
            .with_parents(Parents::new(tips)?)
            .with_nonce_provider(self.get_pow_provider().await, min_pow_score)
            .finish()
            .map_err(|_| Error::TransactionError)?;

        let message_id = self.post_message(&promote_message).await?;
        // Get message if we use remote PoW, because the node will change parents and nonce
        let msg = match self.get_local_pow().await {
            true => promote_message,
            false => self.get_message().data(&message_id).await?,
        };
        Ok((message_id, msg))
    }
/// Promote a message without checking if it should be promoted
Promote a message without checking if it should be promoted
Promote a message without checking if it should be promoted
pub async fn promote_unchecked(&self, message_id: &MessageId) -> Result<(MessageId, Message)> {
        // Create a new message (zero value message) for which one tip would be the actual message
        let mut tips = self.get_tips().await?;
        let min_pow_score = self.get_min_pow_score().await?;
        let network_id = self.get_network_id().await?;
        tips.push(*message_id);
        // Sort tips/parents
        tips.sort_unstable_by_key(|a| a.pack_new());
        tips.dedup();
        let promote_message = MessageBuilder::<ClientMiner>::new()
            .with_network_id(network_id)
            .with_parents(Parents::new(tips)?)
            .with_nonce_provider(self.get_pow_provider().await, min_pow_score)
            .finish()
            .map_err(|_| Error::TransactionError)?;
        let message_id = self.post_message(&promote_message).await?;
        // Get message if we use remote PoW, because the node will change parents and nonce
        let msg = match self.get_local_pow().await {
            true => promote_message,
            false => self.get_message().data(&message_id).await?,
        };
        Ok((message_id, msg))
    }
pub async fn promote_unchecked ( & self , message_id : & MessageId ) -> Result < ( MessageId , Message ) > { // Create a new message (zero value message) for which one tip would be the actual message let mut tips = self . get_tips ( ) . await ? ; let min_pow_score = self . get_min_pow_score ( ) . await ? ; let network_id = self . get_network_id ( ) . await ? ; tips . push ( * message_id ) ; // Sort tips/parents tips . sort_unstable_by_key ( | a | a . pack_new ( ) ) ; tips . dedup ( ) ; let promote_message = MessageBuilder :: < ClientMiner > :: new ( ) . with_network_id ( network_id ) . with_parents ( Parents :: new ( tips ) ? ) . with_nonce_provider ( self . get_pow_provider ( ) . await , min_pow_score ) . finish ( ) . map_err ( | _ | Error :: TransactionError ) ? ; let message_id = self . post_message ( & promote_message ) . await ? ; // Get message if we use remote PoW, because the node will change parents and nonce let msg = match self . get_local_pow ( ) . await { true => promote_message , false => self . get_message ( ) . data ( & message_id ) . await ? , } ; Ok ( ( message_id , msg ) ) }
Promote a message without checking if it should be promoted
Promote a message without checking if it should be promoted
&self
message_id
&MessageId
&self
message_id
&MessageId