Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

fix: feature matrix #29

Closed
wants to merge 1 commit into from
Closed

Conversation

refcell
Copy link

@refcell refcell commented Sep 26, 2023

Description

Fixes tests in the call handlers for the various feature matrices.

Upstream tests were failing because the --all-features flag hit both the optimism and no_gas_measuring flags.

Since no_gas_measuring is used for the crate-level USE_GAS constant, as inlined below, optimism and mainnet tests were not hitting the USE_GAS paths. Further, the mainnet tests were hitting the optimism call handler path since --all-features activated the optimism call_handler.

pub(crate) const USE_GAS: bool = !cfg!(feature = "no_gas_measuring");

@refcell refcell self-assigned this Sep 26, 2023
@refcell refcell requested a review from clabby September 26, 2023 19:10
@@ -107,6 +107,7 @@ pub fn calculate_gas_refund<SPEC: Spec>(env: &Env, gas: &Gas) -> u64 {
}

#[cfg(test)]
#[cfg(not(feature = "optimism"))]
Copy link

@rakita rakita Sep 27, 2023

Choose a reason for hiding this comment

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

Left remove USE_GAS from handle_call_return it would not disrupt anything and would help with tests. no_gas_measuring has been shown to be just an annoyance without much benefit so it is probable that it will be removed.

@refcell refcell closed this Sep 27, 2023
@refcell refcell deleted the refcell/fix-feature-matrix branch September 27, 2023 23:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants