Propagate DispatchError for benchmarks. (#5075)

* Propagate DispatchError for benchmarks.

* Apply review suggestions.

* Use RuntimeString.

* fix expect

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Marcio Diaz
2020-02-28 12:05:27 +01:00
committed by GitHub
parent 25d1b7878a
commit d39605d9cd
5 changed files with 42 additions and 34 deletions
+2 -1
View File
@@ -12,9 +12,10 @@ description = "Macro for benchmarking a FRAME runtime."
codec = { package = "parity-scale-codec", version = "1.1.2", default-features = false }
sp-api = { version = "2.0.0-alpha.2", path = "../../primitives/api", default-features = false }
sp-runtime-interface = { version = "2.0.0-alpha.2", path = "../../primitives/runtime-interface", default-features = false }
sp-runtime = { version = "2.0.0-alpha.2", path = "../../primitives/runtime", default-features = false }
sp-std = { version = "2.0.0-alpha.2", path = "../../primitives/std", default-features = false }
sp-io = { path = "../../primitives/io", default-features = false, version = "2.0.0-alpha.2" }
[features]
default = [ "std" ]
std = [ "sp-runtime-interface/std", "sp-api/std", "codec/std", "sp-std/std" ]
std = [ "sp-runtime-interface/std", "sp-runtime/std", "sp-api/std", "codec/std", "sp-std/std" ]
+2 -1
View File
@@ -19,6 +19,7 @@
use codec::{Encode, Decode};
use sp_std::vec::Vec;
use sp_io::hashing::blake2_256;
use sp_runtime::RuntimeString;
/// An alphabet of possible parameters to use for benchmarking.
#[derive(codec::Encode, codec::Decode, Clone, Copy, PartialEq, Debug)]
@@ -42,7 +43,7 @@ sp_api::decl_runtime_apis! {
extrinsic: Vec<u8>,
steps: Vec<u32>,
repeat: u32,
) -> Option<Vec<BenchmarkResults>>;
) -> Result<Vec<BenchmarkResults>, RuntimeString>;
}
}