Skip to content

Commit

Permalink
Add current_block_gas_limit to EthereumRuntimeRPCApi (paritytech#249)
Browse files Browse the repository at this point in the history
* Add current_block_gas_limit to EthereumRuntimeRPCApi
  • Loading branch information
notlesh authored Feb 16, 2021
1 parent df93657 commit 945e440
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConve
pub struct EthereumFindAuthor<F>(PhantomData<F>);

parameter_types! {
pub BlockGasLimit: u64 = NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WEIGHT_PER_GAS;
pub BlockGasLimit: U256
= U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WEIGHT_PER_GAS);
}

impl pallet_ethereum::Config for Runtime {
Expand Down Expand Up @@ -680,6 +681,10 @@ impl_runtime_apis! {
Ethereum::current_transaction_statuses()
)
}

fn current_block_gas_limit() -> U256 {
<Runtime as pallet_ethereum::Config>::BlockGasLimit::get()
}
}

impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
Expand Down

0 comments on commit 945e440

Please sign in to comment.