Access child storage over RPC. (#2586)

* Access child storage over RPC.

* Address review grumbles.

* Test happy case in child_storage rpc.

* Remove stray printlns

* Fix line widths.

* Bump runtime again.

* Fix genesis storage root calculation for light clients.

* Don't pass values to full_storage_root child_delta.
This commit is contained in:
Tomasz Drwięga
2019-05-19 19:02:09 +02:00
committed by DemiMarie-parity
parent a827869dfb
commit 98de97e1d9
11 changed files with 248 additions and 24 deletions
+21 -1
View File
@@ -102,12 +102,32 @@ impl BuildStorage for StorageOverlay {
fn build_storage(self) -> Result<(StorageOverlay, ChildrenStorageOverlay), String> {
Ok((self, Default::default()))
}
fn assimilate_storage(self, storage: &mut StorageOverlay, _child_storage: &mut ChildrenStorageOverlay) -> Result<(), String> {
fn assimilate_storage(
self,
storage: &mut StorageOverlay,
_child_storage: &mut ChildrenStorageOverlay
) -> Result<(), String> {
storage.extend(self);
Ok(())
}
}
#[cfg(feature = "std")]
impl BuildStorage for (StorageOverlay, ChildrenStorageOverlay) {
fn build_storage(self) -> Result<(StorageOverlay, ChildrenStorageOverlay), String> {
Ok(self)
}
fn assimilate_storage(
self,
storage: &mut StorageOverlay,
child_storage: &mut ChildrenStorageOverlay
)-> Result<(), String> {
storage.extend(self.0);
child_storage.extend(self.1);
Ok(())
}
}
/// Consensus engine unique ID.
pub type ConsensusEngineId = [u8; 4];