From cad28aa283894e08db48df8067534ee1661bf17a Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Sun, 30 Sep 2018 13:16:31 +0100 Subject: [PATCH] metadata returns Bytes (#846) --- substrate/core/rpc/src/state/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/core/rpc/src/state/mod.rs b/substrate/core/rpc/src/state/mod.rs index ff5404460d..47b6647bd2 100644 --- a/substrate/core/rpc/src/state/mod.rs +++ b/substrate/core/rpc/src/state/mod.rs @@ -63,9 +63,9 @@ build_rpc_trait! { #[rpc(name = "state_getStorageSize", alias = ["state_getStorageSizeAt", ])] fn storage_size(&self, StorageKey, Trailing) -> Result>; - /// Returns the runtime metadata as JSON. + /// Returns the runtime metadata as an opaque blob. #[rpc(name = "state_getMetadata")] - fn metadata(&self, Trailing) -> Result>; + fn metadata(&self, Trailing) -> Result; /// Query historical storage entries (by key) starting from a block given as the second parameter. /// @@ -149,9 +149,9 @@ impl StateApi for State where Ok(self.storage(key, block)?.map(|x| x.0.len() as u64)) } - fn metadata(&self, block: Trailing) -> Result> { + fn metadata(&self, block: Trailing) -> Result { let block = self.unwrap_or_best(block)?; - self.client.metadata(&BlockId::Hash(block)).map_err(Into::into) + self.client.metadata(&BlockId::Hash(block)).map(Bytes).map_err(Into::into) } fn query_storage(&self, keys: Vec, from: Block::Hash, to: Trailing) -> Result>> {