state_getSize RPC for storage maps (#6847)

* Fancy compact encode/decode impl for compact solution

* Make it optional

* Remove extra file

* Update primitives/npos-elections/compact/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Final fixes.

* getSize rpc should work for maps as well

* Fix future types

* Remove minimum_validator_count stale const

* Update client/rpc/src/state/mod.rs

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

* "Optimize" `storage_size`

* Remove unused import

* Update doc

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Kian Paimani
2020-08-11 14:09:52 +02:00
committed by GitHub
parent 1519da95d7
commit b0342f0b12
4 changed files with 49 additions and 5 deletions
@@ -214,6 +214,14 @@ impl<Block, F, Client> StateBackend<Block, Client> for LightState<Block, F, Clie
Box::new(result(Err(client_err(ClientError::NotAvailableOnLightClient))))
}
fn storage_size(
&self,
_: Option<Block::Hash>,
_: StorageKey,
) -> FutureResult<Option<u64>> {
Box::new(result(Err(client_err(ClientError::NotAvailableOnLightClient))))
}
fn storage(
&self,
block: Option<Block::Hash>,