Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEB3-333: fix: unstable-history doctest #429

Merged
merged 3 commits into from
Jan 31, 2025
Merged

Conversation

Wollac
Copy link
Contributor

@Wollac Wollac commented Jan 31, 2025

The doctest gets included even though the corresponding method is behind a feature using #[stability::unstable(feature = "history")]. This leads to failing tests if the unstable-history feature is not enabled.
Fixed by adding a hidden #[cfg(feature = "unstable-history")] to the example, in the docs it still looks like the following:

let commitment_hash = B256::from_str("0x1234...")?;
let builder = EthEvmEnv::builder()
    .rpc(Url::parse("https:// ethereum-rpc. publicnode. com")?)
    .beacon_api(Url::parse("https:// ethereum-beacon-api. publicnode. com")?)
    .block_number(1_000_000);  // execute against historical state
let builder = builder.commitment_block_hash(commitment_hash); // commit to recent block
let env = builder.build().await?;

@Wollac Wollac requested a review from a team as a code owner January 31, 2025 10:17
@Wollac Wollac requested a review from nategraf January 31, 2025 10:17
@github-actions github-actions bot changed the title fix: unstable-history doctest WEB3-333: fix: unstable-history doctest Jan 31, 2025
@Wollac Wollac requested a review from capossele January 31, 2025 10:18
@Wollac Wollac merged commit 10d24da into main Jan 31, 2025
10 of 11 checks passed
@Wollac Wollac deleted the fix/unstable-history-doc-test branch January 31, 2025 15:20
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.

2 participants