Improve remote-externalities (#8397)

* make builder generic to allow using different hash types

* expose "cache", "block_number" and "modules" as cli options for live state

* Change Builder to be generic over Block instead of Hash
add rpc method to get hash from block number
allow passing of block numbers and hashes

* fix live tests

* fix formatting in utils/frame/remote-externalities/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* change cli to only accept block hashes
break up lines that were too long
use starts_with instead of match s.get
use unwrap_or_default instead of unwrap_or(Vec::new())

* improve error message

* fix indentation

* replace Block with sp_runtime::testing::Block

* Move cache test out of remote-test feature tests
Add cache file (contains only "Proxy" module) for local test

* simplify match expression to and_then

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Combine the two cfg attributes into one

Co-authored-by: David <dvdplm@gmail.com>

* Restrict visibility of test_prelude use statements to crate level

* Fix usage of and_then

* Rename cache to snapshot

* Remove fully qualified path for Debug

* Refine naming. snapshot to state_snapshot

* Remove unnecessary comment

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Steve Biedermann
2021-03-23 14:23:07 +01:00
committed by GitHub
parent b5b0ef592e
commit f9b6c869a3
5 changed files with 208 additions and 111 deletions
+2 -1
View File
@@ -6564,7 +6564,6 @@ dependencies = [
name = "remote-externalities"
version = "0.9.0"
dependencies = [
"async-std",
"env_logger 0.8.3",
"hex-literal",
"jsonrpsee-http-client",
@@ -6574,6 +6573,8 @@ dependencies = [
"parity-scale-codec",
"sp-core",
"sp-io",
"sp-runtime",
"tokio 0.2.25",
]
[[package]]