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

chore: add EnvironmentArgs and use across all CLI commands #8590

Merged
merged 20 commits into from
Jun 4, 2024

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Jun 4, 2024

--chain, --config and --datadir are all used to initiate an environment that a CLI command will use (config, providers etc).

However, there's a lot of repetition with some commands missing some relevant flags. This PR attempts to fix that and dedup by adding a EnvironmentArgs struct that can initialize all the necessary context.

Feel free to suggest other names other than Environment. CliContext was taken.

Follow-up will be a version of #8553 , and probably moving AccessRights to reth_primitives since there's different versions of the same enum across crates.

@joshieDo joshieDo added C-debt A section of code is hard to understand or change A-cli Related to the reth CLI labels Jun 4, 2024
bin/reth/src/commands/common.rs Outdated Show resolved Hide resolved
bin/reth/src/commands/common.rs Outdated Show resolved Hide resolved
@joshieDo joshieDo enabled auto-merge June 4, 2024 19:21
@joshieDo joshieDo added this pull request to the merge queue Jun 4, 2024
Merged via the queue into main with commit a809574 Jun 4, 2024
29 checks passed
@joshieDo joshieDo deleted the joshie/init-cli-env branch June 4, 2024 19:44
mw2000 pushed a commit to mw2000/reth that referenced this pull request Jun 5, 2024
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-debt A section of code is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants