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

[Debt] Improve consistency of best practice application #32

Merged

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Mar 27, 2024

Closes #30

Apologies for the large file diff, it was unavoidable.

Largely cosmetic changes aimed at increasing consistency across examples.
This helps create a basic style guide to roughly follow for outside contributors.

  • Adds clippy lint rules in workspace root, use the same configuration as Reth. In addition warn on uninlined_format_args
  • Use consistent way of setting up example environment (anvil, provider) where applicable
  • Use ? instead of .unwrap() across all examples
  • url -> rpc_url
  • Refer to tx_request as tx, pending as pending_tx
  • Refer to transaction sending as sending, not broadcast
  • Consistently group code blocks with explaining comment - treat each example as if it is to be understood on its own. Each example should have more detailed comments at the code block it focuses on, less on the setup.
  • In most cases, refer to signer instead of wallet
  • Use Alice and Bob if referring to a from and to pair, if singular from prefer unnamed
  • End comments with a .

Should contain no breaking changes and fundamental changes in behaviour.

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

nice

examples/transactions/examples/trace_transaction.rs Outdated Show resolved Hide resolved
examples/transactions/examples/trace_transaction.rs Outdated Show resolved Hide resolved
@zerosnacks zerosnacks merged commit e716e94 into main Mar 28, 2024
4 checks passed
@zerosnacks zerosnacks deleted the zerosnacks/improve-consistency-of-best-practice-application branch March 28, 2024 08:38
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.

[Debt] Improve consistency and best practices across examples
2 participants