pub fn unlock_account<T>(params: Params, client: ValidatorClient<T>) -> Result<Value, Error>
where
    T: MessageSender,
{
    info!("personal_unlockAccount");

    let (address, password, duration): (String, Option<String>, Option<u64>) = match params.parse()
    {
        Ok((a, p, d)) => (a, p, d),
        Err(err) => {
            warn!("Error encountered while parsing parameters: {:?}", err);
            return Ok(Value::Bool(false));
        }
    };

    Ok(Value::Bool(
        match client.unlock_address(&address, &password, duration) {
            Ok(()) => true,
            Err(err) => {
                error!("Encountered error while unlocking account: {}", err);
                false
            }
        },
    ))
}
/// Unlocks an account, loading it from disk if necessary
Unlocks an account, loading it from disk if necessary
Unlocks an account loading it from disk if necessary
pub fn unlock_account<T>(params: Params, client: ValidatorClient<T>) -> Result<Value, Error>
where
    T: MessageSender,
{
    info!("personal_unlockAccount");
    let (address, password, duration): (String, Option<String>, Option<u64>) = match params.parse()
    {
        Ok((a, p, d)) => (a, p, d),
        Err(err) => {
            warn!("Error encountered while parsing parameters: {:?}", err);
            return Ok(Value::Bool(false));
        }
    };
    Ok(Value::Bool(
        match client.unlock_address(&address, &password, duration) {
            Ok(()) => true,
            Err(err) => {
                error!("Encountered error while unlocking account: {}", err);
                false
            }
        },
    ))
}
pub fn unlock_account < T > ( params : Params , client : ValidatorClient < T > ) -> Result < Value , Error > where T : MessageSender , { info ! ( " " ) ; let ( address , password , duration ) : ( String , Option < String > , Option < u64 > ) = match params . parse ( ) { Ok ( ( a , p , d ) ) => ( a , p , d ) , Err ( err ) => { warn ! ( " " err ) ; return Ok ( Value :: Bool ( false ) ) ; } } ; Ok ( Value :: Bool ( match client . unlock_address ( & address , & password , duration ) { Ok ( ( ) ) => true , Err ( err ) => { error ! ( " " err ) ; false } } , ) ) }
Unlocks an account, loading it from disk if necessary
Unlocks an account loading it from disk if necessary
params
Params
client
ValidatorClient<T>
params
Params
client
ValidatorClient<T>