Skip to content

Commit

Permalink
remove dangerous rpc (paritytech#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
atenjin committed May 24, 2019
1 parent 64bc3d9 commit fb629e2
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions rpc/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ pub trait StateApi<Hash> {
#[rpc(name = "state_call", alias("state_callAt"))]
fn call(&self, name: String, bytes: Bytes, hash: Option<Hash>) -> Result<Bytes>;

/// Returns the keys with prefix, leave empty to get all the keys
#[rpc(name = "state_getKeys")]
fn storage_keys(&self, key: StorageKey, hash: Option<Hash>) -> Result<Vec<StorageKey>>;
// /// Returns the keys with prefix, leave empty to get all the keys
// #[rpc(name = "state_getKeys")]
// fn storage_keys(&self, key: StorageKey, hash: Option<Hash>) -> Result<Vec<StorageKey>>;

/// Returns a storage entry at a specific block's state.
#[rpc(name = "state_getStorage", alias("state_getStorageAt"))]
Expand Down Expand Up @@ -358,17 +358,17 @@ where
Ok(Bytes(return_data))
}

fn storage_keys(
&self,
key_prefix: StorageKey,
block: Option<Block::Hash>,
) -> Result<Vec<StorageKey>> {
let block = self.unwrap_or_best(block)?;
trace!(target: "rpc", "Querying storage keys at {:?}", block);
Ok(self
.client
.storage_keys(&BlockId::Hash(block), &key_prefix)?)
}
// fn storage_keys(
// &self,
// key_prefix: StorageKey,
// block: Option<Block::Hash>,
// ) -> Result<Vec<StorageKey>> {
// let block = self.unwrap_or_best(block)?;
// trace!(target: "rpc", "Querying storage keys at {:?}", block);
// Ok(self
// .client
// .storage_keys(&BlockId::Hash(block), &key_prefix)?)
// }

fn storage(&self, key: StorageKey, block: Option<Block::Hash>) -> Result<Option<StorageData>> {
let block = self.unwrap_or_best(block)?;
Expand Down

0 comments on commit fb629e2

Please sign in to comment.