Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pallet-revive] fix eth-rpc indexing #7493

Merged
merged 27 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nit
pgherveou committed Feb 5, 2025
commit b527fc7d5f1af75cf314c1e62311d1b7c59f45d2
7 changes: 3 additions & 4 deletions substrate/frame/revive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1111,8 +1111,7 @@ where
///
/// - `tx`: The Ethereum transaction to simulate.
/// - `gas_limit`: The gas limit enforced during contract execution.
/// - `tx_fee`: A function that returns the fee for the given call and dispatch info. unchecked
/// extrinsic.
/// - `tx_fee`: A function that returns the fee for the given call and dispatch info.
pub fn bare_eth_transact(
mut tx: GenericTransaction,
gas_limit: Weight,
@@ -1303,7 +1302,7 @@ where
let eth_gas =
T::EthGasEncoder::encode(raw_gas, result.gas_required, result.storage_deposit);

log::debug!(target: LOG_TARGET, "bare_eth_call: raw_gas: {raw_gas:?} eth_gas: {eth_gas:?}");
log::trace!(target: LOG_TARGET, "bare_eth_call: raw_gas: {raw_gas:?} eth_gas: {eth_gas:?}");
result.eth_gas = eth_gas;
Ok(result)
}
@@ -1314,7 +1313,7 @@ where
Self::convert_native_to_evm(T::Currency::reducible_balance(&account, Preserve, Polite))
}

/// Convert an substrate fee into a gas value, using the fixed `GAS_PRICE`.
/// Convert a substrate fee into a gas value, using the fixed `GAS_PRICE`.
/// The gas is calculated as `fee / GAS_PRICE`, rounded up to the nearest integer.
pub fn evm_fee_to_gas(fee: BalanceOf<T>) -> U256 {
let fee = Self::convert_native_to_evm(fee);