Skip to content

Commit

Permalink
The new rpc handle should returns the same data as the old one (#316)
Browse files Browse the repository at this point in the history
* It should return default h256

* Eliminate compile warning
  • Loading branch information
boundless-forest authored Mar 12, 2021
1 parent ed534fa commit 8d54307
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions client/rpc/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use futures::{StreamExt, future::TryFutureExt};
use sp_runtime::{
traits::{Block as BlockT, UniqueSaturatedInto, Zero, One, Saturating, BlakeTwo256},
transaction_validity::TransactionSource,
generic::OpaqueDigestItemId
};
use sp_api::{ProvideRuntimeApi, BlockId, Core, HeaderT};
use sp_transaction_pool::{TransactionPool, InPoolTransaction};
Expand Down Expand Up @@ -472,9 +471,8 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
.get(&schema)
.unwrap_or(&self.fallback)
.storage_at(&id, address, index)
.ok_or(internal_err("Fetching account storage through override failed"))?
.into()
);
.unwrap_or_default()
)
}
Ok(H256::default())
}
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ impl<T: Config> Module<T> {
pub fn remove_account(address: &H160) {
if AccountCodes::contains_key(address) {
let account_id = T::AddressMapping::into_account_id(*address);
frame_system::Module::<T>::dec_ref(&account_id);
let _ = frame_system::Module::<T>::dec_consumers(&account_id);
}

AccountCodes::remove(address);
Expand All @@ -547,7 +547,7 @@ impl<T: Config> Module<T> {

if !AccountCodes::contains_key(&address) {
let account_id = T::AddressMapping::into_account_id(address);
frame_system::Module::<T>::inc_ref(&account_id);
let _ = frame_system::Module::<T>::inc_consumers(&account_id);
}

AccountCodes::insert(address, code);
Expand Down

0 comments on commit 8d54307

Please sign in to comment.