Skip to content

Commit

Permalink
disable storage range for now
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 committed Mar 2, 2024
1 parent 2a6abc0 commit ccd7faa
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 231 deletions.
22 changes: 11 additions & 11 deletions runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1413,17 +1413,17 @@ impl_runtime_apis! {
pallet_evm::AccountStorages::<Runtime>::get(address, H256::from_slice(&tmp[..]))
}

fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
let mut res: Vec<(H256, H256)> = vec![];
for (key, value) in iter {
if res.len() == limit as usize {
return (res, Some(key));
}
res.push((key, value));
}
return (res, None);
}
// fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
// let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
// let mut res: Vec<(H256, H256)> = vec![];
// for (key, value) in iter {
// if res.len() == limit as usize {
// return (res, Some(key));
// }
// res.push((key, value));
// }
// return (res, None);
// }

fn call(
from: H160,
Expand Down
22 changes: 11 additions & 11 deletions runtime/local/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,17 +1451,17 @@ impl_runtime_apis! {
pallet_evm::AccountStorages::<Runtime>::get(address, H256::from_slice(&tmp[..]))
}

fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
let mut res: Vec<(H256, H256)> = vec![];
for (key, value) in iter {
if res.len() == limit as usize {
return (res, Some(key));
}
res.push((key, value));
}
return (res, None);
}
// fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
// let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
// let mut res: Vec<(H256, H256)> = vec![];
// for (key, value) in iter {
// if res.len() == limit as usize {
// return (res, Some(key));
// }
// res.push((key, value));
// }
// return (res, None);
// }

fn call(
from: H160,
Expand Down
22 changes: 11 additions & 11 deletions runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,17 +1629,17 @@ impl_runtime_apis! {
pallet_evm::AccountStorages::<Runtime>::get(address, H256::from_slice(&tmp[..]))
}

fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
let mut res: Vec<(H256, H256)> = vec![];
for (key, value) in iter {
if res.len() == limit as usize {
return (res, Some(key));
}
res.push((key, value));
}
return (res, None);
}
// fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
// let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
// let mut res: Vec<(H256, H256)> = vec![];
// for (key, value) in iter {
// if res.len() == limit as usize {
// return (res, Some(key));
// }
// res.push((key, value));
// }
// return (res, None);
// }

fn call(
from: H160,
Expand Down
22 changes: 11 additions & 11 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,17 +1391,17 @@ impl_runtime_apis! {
pallet_evm::AccountStorages::<Runtime>::get(address, H256::from_slice(&tmp[..]))
}

fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
let mut res: Vec<(H256, H256)> = vec![];
for (key, value) in iter {
if res.len() == limit as usize {
return (res, Some(key));
}
res.push((key, value));
}
return (res, None);
}
// fn storage_range_at(address: H160, start_key: H256, limit: u64) -> (Vec<(H256, H256)>, Option<H256>) {
// let iter = pallet_evm::AccountStorages::<Runtime>::iter_prefix_from(address, start_key.as_bytes().to_vec());
// let mut res: Vec<(H256, H256)> = vec![];
// for (key, value) in iter {
// if res.len() == limit as usize {
// return (res, Some(key));
// }
// res.push((key, value));
// }
// return (res, None);
// }

fn call(
from: H160,
Expand Down
18 changes: 9 additions & 9 deletions vendor/rpc-core/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ pub trait Debug {
id: RequestBlockId,
params: Option<TraceParams>,
) -> RpcResult<Vec<single::TransactionTrace>>;
#[method(name = "debug_storageRangeAt")]
async fn storage_range_at(
&self,
block_hash: H256,
tx_index: u64,
address: H160,
start_key: H256,
limit: u64,
) -> RpcResult<StorageRangeResult>;
// #[method(name = "debug_storageRangeAt")]
// async fn storage_range_at(
// &self,
// block_hash: H256,
// tx_index: u64,
// address: H160,
// start_key: H256,
// limit: u64,
// ) -> RpcResult<StorageRangeResult>;
}
Loading

0 comments on commit ccd7faa

Please sign in to comment.