pub fn sign_txn(&self, txn: RawTransaction) -> Result<SignedTransaction> {
        if let Some(child) = self.addr_map.get(&txn.sender()) {
            let child_key = self.key_factory.private_child(*child)?;
            let signature = child_key.sign(&txn);
            Ok(SignedTransaction::new(
                txn,
                child_key.get_public(),
                signature,
            ))
        } else {
            Err(WalletError::LibraWalletGeneric(
                "Well, that address is nowhere to be found... This is awkward".to_string(),
            )
            .into())
        }
    }
/// Simple public function that allows to sign a Libra RawTransaction with the PrivateKey
/// associated to a particular AccountAddress. If the PrivateKey associated to an
/// AccountAddress is not contained in the addr_map, then this function will return an Error
Simple public function that allows to sign a Libra RawTransaction with the PrivateKey
associated to a particular AccountAddress. If the PrivateKey associated to an
AccountAddress is not contained in the addr_map, then this function will return an Error
Simple public function that allows to sign a Libra RawTransaction with the PrivateKey associated to a particular AccountAddress . If the PrivateKey associated to an AccountAddress is not contained in the addr_map then this function will return an Error
pub fn sign_txn(&self, txn: RawTransaction) -> Result<SignedTransaction> {
        if let Some(child) = self.addr_map.get(&txn.sender()) {
            let child_key = self.key_factory.private_child(*child)?;
            let signature = child_key.sign(&txn);
            Ok(SignedTransaction::new(
                txn,
                child_key.get_public(),
                signature,
            ))
        } else {
            Err(WalletError::LibraWalletGeneric(
                "Well, that address is nowhere to be found... This is awkward".to_string(),
            )
            .into())
        }
    }
pub fn sign_txn ( & self , txn : RawTransaction ) -> Result < SignedTransaction > { if let Some ( child ) = self . addr_map . get ( & txn . sender ( ) ) { let child_key = self . key_factory . private_child ( * child ) ? ; let signature = child_key . sign ( & txn ) ; Ok ( SignedTransaction :: new ( txn , child_key . get_public ( ) , signature , ) ) } else { Err ( WalletError :: LibraWalletGeneric ( " " . to_string ( ) , ) . into ( ) ) } }
Simple public function that allows to sign a Libra RawTransaction with the PrivateKey
associated to a particular AccountAddress.
Simple public function that allows to sign a Libra RawTransaction with the PrivateKey associated to a particular AccountAddress .
&self
txn
RawTransaction
&self
txn
RawTransaction