Skip to content

test: add coverage for get_block_env blob gas#488

Open
vikions wants to merge 2 commits intorisechain:mainfrom
vikions:test/compat-get-block-env-blob-gas
Open

test: add coverage for get_block_env blob gas#488
vikions wants to merge 2 commits intorisechain:mainfrom
vikions:test/compat-get-block-env-blob-gas

Conversation

@vikions
Copy link
Copy Markdown

@vikions vikions commented Apr 9, 2026

Add direct unit tests for compat::get_block_env, especially the blob_excess_gas_and_price branch mentioned in the TODO.

The new tests verify:

  • basic field mapping
  • None behavior when excess_blob_gas is missing
  • correct Cancun vs Prague blob fee fraction selection

This is a narrow test-only change with no behavior changes.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces unit tests for the get_block_env function in crates/pevm/src/compat.rs, ensuring correct field mapping and spec-dependent blob gas price calculations for Cancun and Prague. The review feedback suggests using unwrap_or_default() for the base fee in tests to align with the implementation's fallback behavior and refactoring multiple unwraps of excess_blob_gas into a single variable to improve readability.

Comment thread crates/pevm/src/compat.rs Outdated
Comment thread crates/pevm/src/compat.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant