chore: pass generic header to validate_header_gas (#12931)

This commit is contained in:
maze
2024-11-28 00:03:44 -08:00
committed by GitHub
parent bb0bd77916
commit a3eb302f72
3 changed files with 6 additions and 6 deletions

View File

@ -11,11 +11,11 @@ use revm_primitives::calc_excess_blob_gas;
/// Gas used needs to be less than gas limit. Gas used is going to be checked after execution.
#[inline]
pub const fn validate_header_gas(header: &Header) -> Result<(), ConsensusError> {
if header.gas_used > header.gas_limit {
pub fn validate_header_gas<H: BlockHeader>(header: &H) -> Result<(), ConsensusError> {
if header.gas_used() > header.gas_limit() {
return Err(ConsensusError::HeaderGasUsedExceedsGasLimit {
gas_used: header.gas_used,
gas_limit: header.gas_limit,
gas_used: header.gas_used(),
gas_limit: header.gas_limit(),
})
}
Ok(())