/// Submit a Signed Transfer
// Normally we'd just use the canister client Agent for this but because this
// request is constructed in such an odd way it's easier to just do it from
// scratch
Submit a Signed Transfer
Normally we'd just use the canister client Agent for this but because this
request is constructed in such an odd way it's easier to just do it from
scratch
Submit a Signed Transfer Normally we ' d just use the canister client Agent for this but because this request is constructed in such an odd way it ' s easier to just do it from scratch
pub async fn construction_submit(
        &self,
        msg: models::ConstructionSubmitRequest,
    ) -> Result<ConstructionSubmitResponse, ApiError> {
        verify_network_id(self.ledger.ledger_canister_id(), &msg.network_identifier)?;
        let envelopes = msg.signed_transaction()?;
        let results = self.ledger.submit(envelopes).await?;
        let transaction_identifier = results
            .last_transaction_id()
            .cloned()
            .map(From::from)
            .unwrap_or_else(|| {
                assert!(results
                    .operations
                    .iter()
                    .all(|r| r._type.is_neuron_management()));
                TransactionIdentifier {
                    hash: transaction_id::NEURON_MANAGEMEN_PSEUDO_HASH.to_owned(),
                }
            });
        Ok(ConstructionSubmitResponse {
            transaction_identifier,
            metadata: results.into(),
        })
    }
pub async fn construction_submit ( & self , msg : models :: ConstructionSubmitRequest , ) -> Result < ConstructionSubmitResponse , ApiError > { verify_network_id ( self . ledger . ledger_canister_id ( ) , & msg . network_identifier ) ? ; let envelopes = msg . signed_transaction ( ) ? ; let results = self . ledger . submit ( envelopes ) . await ? ; let transaction_identifier = results . last_transaction_id ( ) . cloned ( ) . map ( From :: from ) . unwrap_or_else ( | | { assert ! ( results operations iter ( ) all ( r r type is_neuron_management ( ) ) ) ; TransactionIdentifier { hash : transaction_id :: NEURON_MANAGEMEN_PSEUDO_HASH . to_owned ( ) , } } ) ; Ok ( ConstructionSubmitResponse { transaction_identifier , metadata : results . into ( ) , } ) }
Submit a Signed Transfer
Normally we'd just use the canister client Agent for this but because this
request is constructed in such an odd way it's easier to just do it from
scratch
Submit a Signed Transfer Normally we ' d just use the canister client Agent for this but because this request is constructed in such an odd way it ' s easier to just do it from scratch
&self
msg
models::ConstructionSubmitRequest