Fix forks_should_work_correctly test (#4152)

When we enabled arbitary precision for `serde_json`, the feature leaked
through the whole workspace. The given test fails because of some bug in
serde json when the feature is enabled.
This commit is contained in:
Bastian Köcher
2019-11-20 09:51:09 +01:00
committed by Gavin Wood
parent 364df30970
commit 75a0a3f6fd
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -10,6 +10,6 @@ impl-trait-for-tuples = "0.1.3"
network = { package = "substrate-network", path = "../network" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
serde = { version = "1.0.101", features = ["derive"] }
serde_json = "1.0.41"
serde_json = { version = "1.0.41", features = [ "arbitrary_precision" ] }
sr-primitives = { path = "../../primitives/sr-primitives" }
tel = { package = "substrate-telemetry", path = "../telemetry" }
+5 -1
View File
@@ -289,7 +289,9 @@ mod tests {
fn forks_should_work_correctly() {
use super::Extension as _ ;
let ext: Ext2 = serde_json::from_str(r#"
// We first need to deserialize into a `Value` because of the following bug:
// https://github.com/serde-rs/json/issues/505
let ext_val: serde_json::Value = serde_json::from_str(r#"
{
"test": 11,
"forkable": {
@@ -314,6 +316,8 @@ mod tests {
}
"#).unwrap();
let ext: Ext2 = serde_json::from_value(ext_val).unwrap();
assert_eq!(ext.get::<Extension1>(), Some(&Extension1 {
test: 11
}));