Bumping sysui & topbar. personal_signerEnabled returns port

This commit is contained in:
Tomasz Drwięga
2016-06-10 15:39:34 +02:00
parent 036b324804
commit e5e238746b
5 changed files with 40 additions and 16 deletions

View File

@@ -31,18 +31,18 @@ pub struct PersonalClient<A, C, M>
accounts: Weak<A>,
client: Weak<C>,
miner: Weak<M>,
signer_enabled: bool,
signer_port: Option<u16>,
}
impl<A, C, M> PersonalClient<A, C, M>
where A: AccountProvider, C: MiningBlockChainClient, M: MinerService {
/// Creates new PersonalClient
pub fn new(store: &Arc<A>, client: &Arc<C>, miner: &Arc<M>, signer_enabled: bool) -> Self {
pub fn new(store: &Arc<A>, client: &Arc<C>, miner: &Arc<M>, signer_port: Option<u16>) -> Self {
PersonalClient {
accounts: Arc::downgrade(store),
client: Arc::downgrade(client),
miner: Arc::downgrade(miner),
signer_enabled: signer_enabled,
signer_port: signer_port,
}
}
}
@@ -51,7 +51,9 @@ impl<A: 'static, C: 'static, M: 'static> Personal for PersonalClient<A, C, M>
where A: AccountProvider, C: MiningBlockChainClient, M: MinerService {
fn signer_enabled(&self, _: Params) -> Result<Value, Error> {
to_value(&self.signer_enabled)
self.signer_port
.map(|v| to_value(&v))
.unwrap_or_else(|| to_value(&false))
}
fn accounts(&self, _: Params) -> Result<Value, Error> {