Merge pull request #6162 from paritytech/fix-whisper-sub-name

fix subscription name
This commit is contained in:
Robert Habermeier 2017-07-27 15:51:47 +02:00 committed by GitHub
commit d53028d0a8
2 changed files with 14 additions and 8 deletions

View File

@ -282,9 +282,11 @@ impl FullDependencies {
}
},
Api::EthPubSub => {
let client = EthPubSubClient::new(self.client.clone(), self.remote.clone());
self.client.add_notify(client.handler());
handler.extend_with(client.to_delegate());
if !for_generic_pubsub {
let client = EthPubSubClient::new(self.client.clone(), self.remote.clone());
self.client.add_notify(client.handler());
handler.extend_with(client.to_delegate());
}
},
Api::Personal => {
handler.extend_with(PersonalClient::new(&self.secret_store, dispatcher.clone(), self.geth_compatibility).to_delegate());
@ -353,9 +355,13 @@ impl FullDependencies {
}
}
Api::WhisperPubSub => {
if let Some(ref whisper_rpc) = self.whisper_rpc {
let whisper = whisper_rpc.make_handler();
handler.extend_with(::parity_whisper::rpc::WhisperPubSub::to_delegate(whisper));
if !for_generic_pubsub {
if let Some(ref whisper_rpc) = self.whisper_rpc {
let whisper = whisper_rpc.make_handler();
handler.extend_with(
::parity_whisper::rpc::WhisperPubSub::to_delegate(whisper)
);
}
}
}
}

View File

@ -132,9 +132,9 @@ build_rpc_trait! {
pub trait WhisperPubSub {
type Metadata;
#[pubsub(name = "hello")] {
#[pubsub(name = "shh_subscription")] {
/// Subscribe to messages matching the filter.
#[rpc(name = "ssh_subscribe")]
#[rpc(name = "shh_subscribe")]
fn subscribe(&self, Self::Metadata, pubsub::Subscriber<types::FilterItem>, types::FilterRequest);
/// Unsubscribe from filter matching given ID. Return