chore: add chain_id shortcut (#11782)

This commit is contained in:
Matthias Seitz
2024-10-16 10:59:20 +02:00
committed by GitHub
parent a6358d2e6f
commit a14a9fd8b0

View File

@ -14,9 +14,14 @@ pub trait EthChainSpec: Send + Sync + Unpin + Debug {
// todo: make chain spec type generic over hardfork
//type Hardfork: Clone + Copy + 'static;
/// Chain id.
/// Returns the [`Chain`] object this spec targets.
fn chain(&self) -> Chain;
/// Returns the chain id number
fn chain_id(&self) -> u64 {
self.chain().id()
}
/// Get the [`BaseFeeParams`] for the chain at the given block.
fn base_fee_params_at_block(&self, block_number: u64) -> BaseFeeParams;