RPC: expose chain spec properties (#1104)

* Add properties to chain spec

* Read properties as serde_json::Value

* Use a serde json::map::Map directly for properties

* Add type alias for json Map

* Update chain_spec.rs
This commit is contained in:
Andrew Jones
2018-11-12 18:58:44 +00:00
committed by Gav Wood
parent 57b2896332
commit db075b57f0
8 changed files with 42 additions and 4 deletions
+11
View File
@@ -27,6 +27,9 @@ impl SystemApi for () {
fn system_chain(&self) -> Result<String> {
Ok("testchain".into())
}
fn system_properties(&self) -> Result<serde_json::map::Map<String, serde_json::Value>> {
Ok(serde_json::map::Map::new())
}
}
#[test]
@@ -52,3 +55,11 @@ fn system_chain_works() {
"testchain".to_owned()
);
}
#[test]
fn system_properties_works() {
assert_eq!(
SystemApi::system_properties(&()).unwrap(),
serde_json::map::Map::new()
);
}