You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: wallet_library.rs
    path of file: ./repos/diem/testsuite/cli/diem-wallet/src
    
    the code of the file until where you have to start completion: // Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

//! The following document is a minimalist version of Diem Wallet. Note that this Wallet does
//! not promote security as the mnemonic is stored in unencrypted form. In future iterations,
//! we will be releasing more robust Wallet implementations. It is our intention to present a
//! foundation that is simple to understand and incrementally improve the DiemWallet
//! implementation and it's security guarantees throughout testnet. For a more robust wallet
//! reference, th
    
    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::DiemWalletGeneric(
                "Well, that address is nowhere to be found... This is awkward".to_string(),
            )
            .into())
        }
    }