Skip to content

Commit

Permalink
fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Apr 30, 2024
1 parent ec8b9ab commit 0f56abe
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,6 @@ impl_runtime_apis! {
}

impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {
use pallet_evm::GasWeightMapping as _;

fn chain_id() -> u64 {
<Runtime as pallet_evm::Config>::ChainId::get()
}
Expand Down Expand Up @@ -793,6 +791,8 @@ impl_runtime_apis! {
estimate: bool,
access_list: Option<Vec<(H160, Vec<H256>)>>,
) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {
use pallet_evm::GasWeightMapping as _;

let config = if estimate {
let mut config = <Runtime as pallet_evm::Config>::config().clone();
config.estimate = true;
Expand Down Expand Up @@ -822,7 +822,12 @@ impl_runtime_apis! {
estimated_transaction_len += access_list.encoded_size();
}

let gas_limit = gas_limit.min(u64::MAX.into());

let gas_limit = if gas_limit > U256::from(u64::MAX) {
u64::MAX
} else {
gas_limit.low_u64()
};
let without_base_extrinsic_weight = true;

let (weight_limit, proof_size_base_cost) =
Expand Down Expand Up @@ -865,6 +870,8 @@ impl_runtime_apis! {
estimate: bool,
access_list: Option<Vec<(H160, Vec<H256>)>>,
) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {
use pallet_evm::GasWeightMapping as _;

let config = if estimate {
let mut config = <Runtime as pallet_evm::Config>::config().clone();
config.estimate = true;
Expand Down Expand Up @@ -894,7 +901,12 @@ impl_runtime_apis! {
estimated_transaction_len += access_list.encoded_size();
}

let gas_limit = gas_limit.min(u64::MAX.into());

let gas_limit = if gas_limit > U256::from(u64::MAX) {
u64::MAX
} else {
gas_limit.low_u64()
};
let without_base_extrinsic_weight = true;

let (weight_limit, proof_size_base_cost) =
Expand Down

0 comments on commit 0f56abe

Please sign in to comment.