Refactor the runtime API to use traits. (#878)

* Add missing `As` imports.

* Adds new API traits that will be used by the client and runtime

* Switch consensus to new API's

* Switches transaction-pool to new API's

* Move runtime api stuff into its own crate

* Adds `impl_apis!` macro for implementing the new API traits

* Make `metadata` return directly a blob

* Runtime replace `impl_stubs!` with `impl_apis!`

* Switches to none feature based approach for declaring the different API traits

* Fixes compilation error

* Fixes errors

* Make the `decl_apis!` trait usable from the outside

* Make the `test-client` use the new API traits

* Remove last `impl_stubs!` bits and move some of them into wasm executor for tests

* A little bit more documentation
This commit is contained in:
Bastian Köcher
2018-10-09 10:58:29 +02:00
committed by Gav Wood
parent fb058ae235
commit 2c65ad6c7b
25 changed files with 1058 additions and 256 deletions
+3 -1
View File
@@ -8,9 +8,10 @@ rustc-hex = "1.0"
hex-literal = "0.1.0"
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", optional = true }
safe-mix = { version = "1.0", default-features = false}
safe-mix = { version = "1.0", default-features = false }
parity-codec = "2.0"
parity-codec-derive = "2.0"
sr-api = { path = "../../core/sr-api", default-features = false }
sr-std = { path = "../../core/sr-std" }
sr-io = { path = "../../core/sr-io" }
srml-support = { path = "../../srml/support" }
@@ -36,6 +37,7 @@ default = ["std"]
std = [
"parity-codec/std",
"substrate-primitives/std",
"sr-api/std",
"sr-std/std",
"sr-io/std",
"srml-support/std",