Add RPC function state_getProof, resolves #1110 (#5649)

* Add RPC function state_getProof, resolves #1110

* Apply suggestions from code review

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

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

* Update Cargo.lock

* Make block hash optional

* Wrap StorageProof as Bytes

* Add struct ReadProof

* Fix typo

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Yuanchao Sun
2020-04-21 03:09:55 +08:00
committed by GitHub
parent 0ce9657db2
commit 52d0173ec3
5 changed files with 82 additions and 7 deletions
@@ -38,7 +38,7 @@ use rpc::{
futures::stream::Stream,
};
use sc_rpc_api::Subscriptions;
use sc_rpc_api::{Subscriptions, state::ReadProof};
use sp_blockchain::{Error as ClientError, HeaderBackend};
use sc_client::{
BlockchainEvents,
@@ -279,6 +279,14 @@ impl<Block, F, Client> StateBackend<Block, Client> for LightState<Block, F, Clie
Box::new(result(Err(client_err(ClientError::NotAvailableOnLightClient))))
}
fn read_proof(
&self,
_block: Option<Block::Hash>,
_keys: Vec<StorageKey>,
) -> FutureResult<ReadProof<Block::Hash>> {
Box::new(result(Err(client_err(ClientError::NotAvailableOnLightClient))))
}
fn subscribe_storage(
&self,
_meta: crate::metadata::Metadata,