[RPC] Move runtime version from chain to state (#1243)

* Move runtimeVersion to state, add rudimentary test for subscription.

* Bump to latest jsonrpc.
This commit is contained in:
Tomasz Drwięga
2018-12-10 18:46:39 +00:00
committed by Robert Habermeier
parent 6299b42a4d
commit d28fda3d84
6 changed files with 121 additions and 104 deletions
+1 -17
View File
@@ -17,7 +17,7 @@
use super::*;
use jsonrpc_macros::pubsub;
use test_client::{self, TestClient};
use test_client::runtime::{Block, Header, VERSION};
use test_client::runtime::{Block, Header};
use consensus::BlockOrigin;
#[test]
@@ -246,19 +246,3 @@ fn should_notify_about_finalised_block() {
// no more notifications on this channel
assert_eq!(core.block_on(next.into_future()).unwrap().0, None);
}
#[test]
fn should_return_runtime_version() {
let core = ::tokio::runtime::Runtime::new().unwrap();
let remote = core.executor();
let client = Chain {
client: Arc::new(test_client::new()),
subscriptions: Subscriptions::new(remote),
};
assert_matches!(
client.runtime_version(None.into()),
Ok(ref ver) if ver == &VERSION
);
}