diff --git a/src/lib.rs b/src/lib.rs index b790083cd8a..e6ac9e1ef3f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,13 +258,12 @@ impl Client { &self.metadata } - /// Fetch a StorageKey with an optional block hash. - pub async fn fetch>( + /// Fetch the value under an unhashed storage key + pub async fn fetch_unhashed( &self, - store: &F, + key: StorageKey, hash: Option, - ) -> Result, Error> { - let key = store.key(&self.metadata)?; + ) -> Result, Error> { if let Some(data) = self.rpc.storage(&key, hash).await? { Ok(Some(Decode::decode(&mut &data.0[..])?)) } else { @@ -272,6 +271,16 @@ impl Client { } } + /// Fetch a StorageKey with an optional block hash. + pub async fn fetch>( + &self, + store: &F, + hash: Option, + ) -> Result, Error> { + let key = store.key(&self.metadata)?; + self.fetch_unhashed::(key, hash).await + } + /// Fetch a StorageKey that has a default value with an optional block hash. pub async fn fetch_or_default>( &self,