pub async fn finish(self) -> Result<MessageId> {
        let index = self.index;
        let data = self.data.unwrap_or_default();

        // build indexation
        let index = Indexation::new(index, &data).map_err(|e| Error::IndexationError(e.to_string()))?;

        // get tips
        let tips = self.client.get_tips().await?;

        // building message
        let payload = Payload::Indexation(Box::new(index));
        let message = MessageBuilder::<ClientMiner>::new()
            .with_network_id(self.client.get_network_id().await?)
            .with_parent1(tips.0)
            .with_parent2(tips.1)
            .with_payload(payload)
            .with_nonce_provider(self.client.get_pow_provider(), 4000f64)
            .finish()
            .map_err(|e| Error::IndexationError(e.to_string()))?;

        self.client.post_message(&message).await
    }
/// Consume the builder and get the API result
Consume the builder and get the API result
Consume the builder and get the API result
pub async fn finish(self) -> Result<MessageId> {
        let index = self.index;
        let data = self.data.unwrap_or_default();
        // build indexation
        let index = Indexation::new(index, &data).map_err(|e| Error::IndexationError(e.to_string()))?;
        // get tips
        let tips = self.client.get_tips().await?;
        // building message
        let payload = Payload::Indexation(Box::new(index));
        let message = MessageBuilder::<ClientMiner>::new()
            .with_network_id(self.client.get_network_id().await?)
            .with_parent1(tips.0)
            .with_parent2(tips.1)
            .with_payload(payload)
            .with_nonce_provider(self.client.get_pow_provider(), 4000f64)
            .finish()
            .map_err(|e| Error::IndexationError(e.to_string()))?;
        self.client.post_message(&message).await
    }
pub async fn finish ( self ) -> Result < MessageId > { let index = self . index ; let data = self . data . unwrap_or_default ( ) ; // build indexation let index = Indexation :: new ( index , & data ) . map_err ( | e | Error :: IndexationError ( e . to_string ( ) ) ) ? ; // get tips let tips = self . client . get_tips ( ) . await ? ; // building message let payload = Payload :: Indexation ( Box :: new ( index ) ) ; let message = MessageBuilder :: < ClientMiner > :: new ( ) . with_network_id ( self . client . get_network_id ( ) . await ? ) . with_parent1 ( tips . 0 ) . with_parent2 ( tips . 1 ) . with_payload ( payload ) . with_nonce_provider ( self . client . get_pow_provider ( ) , 4000f64 ) . finish ( ) . map_err ( | e | Error :: IndexationError ( e . to_string ( ) ) ) ? ; self . client . post_message ( & message ) . await }
Consume the builder and get the API result
Consume the builder and get the API result
self
self