Skip to content

Commit

Permalink
Remove useless param (#351)
Browse files Browse the repository at this point in the history
* Remove useless client param

* Update version

* Make compile happly
  • Loading branch information
boundless-forest authored Apr 9, 2021
1 parent f00852a commit 4ccdaa0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sc-rpc = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git
sc-network = { version = "0.9.0", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallet-evm = { version = "3.0.0", path = "../../frame/evm" }
fp-evm = { version = "1.0.0", path = "../../primitives/evm" }
pallet-ethereum = { version = "1.0.0", path = "../../frame/ethereum" }
pallet-ethereum = { version = "1.0.1-dev", path = "../../frame/ethereum" }
ethereum = { version = "0.7.1", features = ["with-codec"] }
codec = { package = "parity-scale-codec", version = "2.0.0" }
rlp = "0.5"
Expand Down
12 changes: 6 additions & 6 deletions client/rpc/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
}

fn block_by_hash(&self, hash: H256, full: bool) -> Result<Option<RichBlock>> {
let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down Expand Up @@ -484,7 +484,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
}

fn block_transaction_count_by_hash(&self, hash: H256) -> Result<Option<U256>> {
let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down Expand Up @@ -858,7 +858,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
},
};

let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down Expand Up @@ -887,7 +887,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
hash: H256,
index: Index,
) -> Result<Option<Transaction>> {
let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down Expand Up @@ -948,7 +948,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
None => return Ok(None),
};

let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down Expand Up @@ -1035,7 +1035,7 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
fn logs(&self, filter: Filter) -> Result<Vec<Log>> {
let mut blocks_and_statuses = Vec::new();
if let Some(hash) = filter.block_hash.clone() {
let id = match frontier_backend_client::load_hash::<B, C>(self.client.as_ref(), self.backend.as_ref(), hash)
let id = match frontier_backend_client::load_hash::<B>(self.backend.as_ref(), hash)
.map_err(|err| internal_err(format!("{:?}", err)))?
{
Some(hash) => hash,
Expand Down
6 changes: 2 additions & 4 deletions client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub mod frontier_backend_client {
{
Ok(match number.unwrap_or(BlockNumber::Latest) {
BlockNumber::Hash { hash, .. } => {
load_hash::<B, C>(client, backend, hash).unwrap_or(None)
load_hash::<B>(backend, hash).unwrap_or(None)
},
BlockNumber::Num(number) => {
Some(BlockId::Number(number.unique_saturated_into()))
Expand All @@ -82,11 +82,9 @@ pub mod frontier_backend_client {
})
}

pub fn load_hash<B: BlockT, C>(client: &C, backend: &fc_db::Backend<B>, hash: H256) -> RpcResult<Option<BlockId<B>>> where
pub fn load_hash<B: BlockT>(backend: &fc_db::Backend<B>, hash: H256) -> RpcResult<Option<BlockId<B>>> where
B: BlockT,
C: HeaderBackend<B> + 'static,
B: BlockT<Hash=H256> + Send + Sync + 'static,
C: Send + Sync + 'static,
{
let substrate_hash = backend.mapping().block_hash(&hash)
.map_err(|err| internal_err(format!("fetch aux store failed: {:?}", err)))?;
Expand Down
2 changes: 1 addition & 1 deletion frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-ethereum"
version = "1.0.0"
version = "1.0.1-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
description = "Ethereum compatibility full block processing emulation pallet for Substrate."
Expand Down
2 changes: 1 addition & 1 deletion frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use frame_support::{
};
use sp_std::prelude::*;
use frame_system::ensure_none;
use frame_support::{ensure, traits::UnfilteredDispatchable};
use frame_support::ensure;
use ethereum_types::{H160, H64, H256, U256, Bloom, BloomInput};
use sp_runtime::{
transaction_validity::{
Expand Down

0 comments on commit 4ccdaa0

Please sign in to comment.