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

feat: add sanity tests for Args Default impls #5660

Merged
merged 3 commits into from
Dec 2, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Dec 1, 2023

ref #5658 (review)

added tests accordingly, this was a very good idea, since the GasPriceOracleArgs::default impl just set everyting to None

@Rjected Rjected added C-enhancement New feature or request C-test A change that impacts how or what we test A-cli Related to the reth CLI labels Dec 1, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm,
can do constants issue as good first issue

Comment on lines +27 to +30
blocks: Some(20),
ignore_price: Some(2),
max_price: Some(500000000000),
percentile: Some(60),
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's open an issue to replace those with constants

Comment on lines 52 to 58
extradata: default_extradata(),
max_gas_limit: 30_000_000,
interval: Duration::from_secs(1),
deadline: Duration::from_secs(12),
max_payload_tasks: 3,
#[cfg(feature = "optimism")]
compute_pending_block: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should use the config's default here

impl Default for BasicPayloadJobGeneratorConfig {
fn default() -> Self {
let mut extradata = BytesMut::new();
RETH_CLIENT_VERSION.as_bytes().encode(&mut extradata);
Self {
extradata: extradata.freeze().into(),
max_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
interval: Duration::from_secs(1),
// 12s slot time
deadline: SLOT_DURATION,
max_payload_tasks: 3,
#[cfg(feature = "optimism")]
compute_pending_block: false,
}
}
}

@Rjected Rjected added this pull request to the merge queue Dec 2, 2023
Merged via the queue into main with commit 585bc31 Dec 2, 2023
27 checks passed
@Rjected Rjected deleted the dan/add-args-default-tests branch December 2, 2023 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI C-enhancement New feature or request C-test A change that impacts how or what we test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants