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: keys_keeper_u.rs
    path of file: ./repos/enigma-core/enigma-principal/app/src/esgx
    
    the code of the file until where you have to start completion: use std::{convert::TryInto, mem};

use failure::Error;
use sgx_types::{sgx_enclave_id_t, sgx_status_t};
use web3::types::U256;

use boot_network::keys_provider_http::{StateKeyRequest, StateKeyResponse, StringWrapper};
use common_u::errors::EnclaveFailError;
use enigma_types::{ContractAddress, EnclaveReturn, traits::SliceCPtr};

extern "C" {
    fn ecall_get_enc_state_keys(
        eid: sgx_enclave_id_t, retval: &mut EnclaveReturn, msg: *const u8, msg_len: usize, addrs: *const u8, addrs_len: usize,
        sig: &[u8; 65], epoch_nonce: &[u8; 32], s
    
pub fn get_enc_state_keys(eid: sgx_enclave_id_t, request: StateKeyRequest, epoch_nonce: U256, sc_addrs: &[ContractAddress]) -> Result<StateKeyResponse, Error> {
    let mut retval: EnclaveReturn = EnclaveReturn::Success;
    let mut sig_out: [u8; 65] = [0; 65];
    let mut response_ptr = 0u64;
    let epoch_nonce: [u8; 32] = epoch_nonce.into();

    let msg_bytes: Vec<u8> = request.data.try_into()?;
    let status = unsafe {
        ecall_get_enc_state_keys(
            eid,
            &mut retval,
            msg_bytes.as_c_ptr() as *const u8,
            msg_bytes.len(),
            sc_addrs.as_c_ptr() as *const u8,
            mem::size_of_val(sc_addrs),
            &request.sig.try_into()?,
            &epoch_nonce,
            &mut response_ptr as *mut u64,
            &mut sig_out,
        )
    };
    if retval != EnclaveReturn::Success || status != sgx_status_t::SGX_SUCCESS {
        return Err(EnclaveFailError { err: retval, status }.into());
    }
    let box_ptr = response_ptr as *mut Box<[u8]>;
    let response = unsafe { Box::from_raw(box_ptr) };
    Ok(StateKeyResponse { data: StringWrapper::from(&response[..]), sig: StringWrapper::from(&sig_out[..]) })
}