Merge branch 'master' into ui-2
# Conflicts: # js/package.json # js/src/api/local/ethkey/worker.js # js/src/modals/FirstRun/TnC/tnc.js # js/src/modals/FirstRun/Welcome/welcome.js # js/src/ui/Form/Input/input.js # js/src/ui/VaultCard/Accounts/accounts.spec.js # js/src/views/Accounts/accounts.js # js/src/views/Application/TabBar/tabBar.js # js/src/views/Settings/Views/defaults.js # js/src/views/Settings/Views/views.js # js/webpack/app.js # js/webpack/libraries.js
This commit is contained in:
@@ -51,10 +51,10 @@ impl HttpMetaExtractor for RpcExtractor {
|
||||
}
|
||||
|
||||
impl ipc::MetaExtractor<Metadata> for RpcExtractor {
|
||||
fn extract(&self, _req: &ipc::RequestContext) -> Metadata {
|
||||
fn extract(&self, req: &ipc::RequestContext) -> Metadata {
|
||||
let mut metadata = Metadata::default();
|
||||
// TODO [ToDr] Extract proper session id when it's available in context.
|
||||
metadata.origin = Origin::Ipc(1.into());
|
||||
metadata.origin = Origin::Ipc(req.session_id.into());
|
||||
metadata.session = Some(Arc::new(Session::new(req.sender.clone())));
|
||||
metadata
|
||||
}
|
||||
}
|
||||
@@ -77,8 +77,8 @@ impl ws::MetaExtractor<Metadata> for WsExtractor {
|
||||
fn extract(&self, req: &ws::RequestContext) -> Metadata {
|
||||
let mut metadata = Metadata::default();
|
||||
let id = req.session_id as u64;
|
||||
// TODO [ToDr] Extract dapp from Origin
|
||||
let dapp = "".into();
|
||||
|
||||
let dapp = req.origin.as_ref().map(|origin| (&**origin).into()).unwrap_or_default();
|
||||
metadata.origin = match self.authcodes_path {
|
||||
Some(ref path) => {
|
||||
let authorization = req.protocols.get(0).and_then(|p| auth_token_hash(&path, p));
|
||||
|
||||
@@ -74,10 +74,10 @@ impl<C> ChainNotificationHandler<C> {
|
||||
for subscriber in self.heads_subscribers.lock().values() {
|
||||
for &(ref block, ref extra_info) in &blocks {
|
||||
self.remote.spawn(subscriber
|
||||
.notify(pubsub::Result::Header(RichHeader {
|
||||
.notify(Ok(pubsub::Result::Header(RichHeader {
|
||||
inner: block.into(),
|
||||
extra_info: extra_info.clone(),
|
||||
}))
|
||||
})))
|
||||
.map(|_| ())
|
||||
.map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e))
|
||||
);
|
||||
|
||||
@@ -307,6 +307,11 @@ impl<C, M, S: ?Sized, U> Parity for ParityClient<C, M, S, U> where
|
||||
}
|
||||
|
||||
fn local_transactions(&self) -> Result<BTreeMap<H256, LocalTransactionStatus>, Error> {
|
||||
// Return nothing if accounts are disabled (running as public node)
|
||||
if self.accounts.is_none() {
|
||||
return Ok(BTreeMap::new());
|
||||
}
|
||||
|
||||
let transactions = self.miner.local_transactions();
|
||||
let block_number = self.client.chain_info().best_block_number;
|
||||
Ok(transactions
|
||||
|
||||
@@ -72,13 +72,7 @@ impl<S: core::Middleware<Metadata>> PubSub for PubSubClient<S> {
|
||||
let (id, receiver) = poll_manager.subscribe(meta, method, params);
|
||||
match subscriber.assign_id(id.clone()) {
|
||||
Ok(sink) => {
|
||||
self.remote.spawn(receiver.map(|res| match res {
|
||||
Ok(val) => val,
|
||||
Err(error) => {
|
||||
warn!(target: "pubsub", "Subscription error: {:?}", error);
|
||||
core::Value::Null
|
||||
},
|
||||
}).forward(sink.sink_map_err(|e| {
|
||||
self.remote.spawn(receiver.forward(sink.sink_map_err(|e| {
|
||||
warn!("Cannot send notification: {:?}", e);
|
||||
})).map(|_| ()));
|
||||
},
|
||||
|
||||
@@ -61,7 +61,7 @@ impl<D: Dispatcher + 'static> SignerClient<D> {
|
||||
for subscription in subs.lock().values() {
|
||||
let subscription: &Sink<_> = subscription;
|
||||
remote.spawn(subscription
|
||||
.notify(requests.clone())
|
||||
.notify(Ok(requests.clone()))
|
||||
.map(|_| ())
|
||||
.map_err(|e| warn!(target: "rpc", "Unable to send notification: {}", e))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user