Make sure frame examples compile for wasm (#5332)

* Make sure frame examples compile for wasm

This makes sure that `frame-example` and `frame-example-offchain-worker`
compile for wasm.

This also fixes compilation for these crates. The offchain worker
example doesn't use serde-json anymore as that is too heavy and breaks
`no_std` compilation.

* Apply suggestions from code review

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
Bastian Köcher
2020-03-20 16:57:39 +01:00
committed by GitHub
parent 57af4facbd
commit 46458f4082
6 changed files with 93 additions and 32 deletions
@@ -17,7 +17,7 @@ sp-core = { version = "2.0.0-alpha.4", default-features = false, path = "../../p
sp-io = { version = "2.0.0-alpha.4", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "2.0.0-alpha.4", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "2.0.0-alpha.4", default-features = false, path = "../../primitives/std" }
serde_json = { version = "1.0.46", default-features = false, features = ["alloc"] }
lite-json = { version = "0.1", default-features = false }
[features]
default = ["std"]
@@ -26,6 +26,7 @@ std = [
"frame-support/std",
"frame-system/std",
"serde",
"lite-json/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",