pub fn try_generate_viewing_key<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    env: Env,
    entropy: String,
) -> StdResult<HandleResponse> {
    let config: State = load(&mut deps.storage, CONFIG_KEY)?;
    let prng_seed = config.prng_seed;

    let key = ViewingKey::new(&env, &prng_seed, (&entropy).as_ref());

    let message_sender = deps.api.canonical_address(&env.message.sender)?;

    write_viewing_key(&mut deps.storage, &message_sender, &key);

    Ok(HandleResponse {
        messages: vec![],
        log: vec![],
        data: Some(to_binary(&HandleAnswer::GenerateViewingKey { 
            key,
        })?),
    })
}
// fn to generate viewing keys for handle
fn to generate viewing keys for handle
fn to generate viewing keys for handle
pub fn try_generate_viewing_key<S: Storage, A: Api, Q: Querier>(
    deps: &mut Extern<S, A, Q>,
    env: Env,
    entropy: String,
) -> StdResult<HandleResponse> {
    let config: State = load(&mut deps.storage, CONFIG_KEY)?;
    let prng_seed = config.prng_seed;
    let key = ViewingKey::new(&env, &prng_seed, (&entropy).as_ref());
    let message_sender = deps.api.canonical_address(&env.message.sender)?;
    write_viewing_key(&mut deps.storage, &message_sender, &key);
    Ok(HandleResponse {
        messages: vec![],
        log: vec![],
        data: Some(to_binary(&HandleAnswer::GenerateViewingKey { 
            key,
        })?),
    })
}
pub fn try_generate_viewing_key < S : Storage , A : Api , Q : Querier > ( deps : & mut Extern < S , A , Q > , env : Env , entropy : String , ) -> StdResult < HandleResponse > { let config : State = load ( & mut deps . storage , CONFIG_KEY ) ? ; let prng_seed = config . prng_seed ; let key = ViewingKey :: new ( & env , & prng_seed , ( & entropy ) . as_ref ( ) ) ; let message_sender = deps . api . canonical_address ( & env . message . sender ) ? ; write_viewing_key ( & mut deps . storage , & message_sender , & key ) ; Ok ( HandleResponse { messages : vec ! [ ] , log : vec ! [ ] , data : Some ( to_binary ( & HandleAnswer :: GenerateViewingKey { key , } ) ? ) , } ) }
fn to generate viewing keys for handle
fn to generate viewing keys for handle
deps
&mut Extern<S, A, Q>
env
Env
entropy
String
deps
&mut Extern<S, A, Q>
env
Env
entropy
String