mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add chain_id shortcut (#11782)
This commit is contained in:
@ -14,9 +14,14 @@ pub trait EthChainSpec: Send + Sync + Unpin + Debug {
|
|||||||
// todo: make chain spec type generic over hardfork
|
// todo: make chain spec type generic over hardfork
|
||||||
//type Hardfork: Clone + Copy + 'static;
|
//type Hardfork: Clone + Copy + 'static;
|
||||||
|
|
||||||
/// Chain id.
|
/// Returns the [`Chain`] object this spec targets.
|
||||||
fn chain(&self) -> Chain;
|
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.
|
/// Get the [`BaseFeeParams`] for the chain at the given block.
|
||||||
fn base_fee_params_at_block(&self, block_number: u64) -> BaseFeeParams;
|
fn base_fee_params_at_block(&self, block_number: u64) -> BaseFeeParams;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user