-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add logging to Flashbots module - Add logger to Flashbots class - Include log messages for key operations: - Sending bundle - Simulating bundle - Sending private transaction - Cancelling private transaction - Use proper logging instead of print in example.py * refactor simple.py * Refactor FlashbotProvider for improved clarity and efficiency - Streamline header combination in make_request method - Update docstring to accurately reflect provider's purpose - Improve overall code readability * Switch from Black to Ruff for code formatting and linting - Remove Black configuration and dependencies - Add Ruff configuration and dependencies - Update VSCode settings for Python to use Ruff - Add pre-commit config for Ruff - Replace GitHub Actions workflow for Black with Ruff - Update pyproject.toml to configure Ruff * Refactor: Format and lint code with ruff - Reorder and optimize imports across multiple files - Remove unused imports - Standardize import order and grouping - Minor code formatting adjustments - Remove trailing whitespace This commit improves code consistency and readability by applying ruff's linting and formatting rules to the project. * Refactor flashbot function and improve type safety - Introduce FlashbotsWeb3 class to enhance type checking - Remove Goerli-specific PoA middleware injection - Update flashbot function to return FlashbotsWeb3 instance - Improve error handling for environment variables in examples - Enhance address handling with Web3.to_checksum_address - Update transaction nonce type to use web3.types.Nonce - Minor code style improvements and type annotations * Refactor network configuration and setup - Add flashbots/constants.py with FLASHBOTS_NETWORKS - Update flashbots/types.py to include new network types - Modify setup_web3 function to use the new network configuration - Remove NETWORK_CONFIG and related functions from examples/simple.py * Improve transaction creation and gas price handling - Update create_transaction function to dynamically calculate gas prices - Modify transaction creation in main function * Enhance simple.py example and improve Flashbots module - Add command-line arguments for network selection and log level - Implement dynamic logging configuration - Update docstrings with usage instructions and examples - Refactor network type to 'Network' for consistency - Add get_networks() function to retrieve available networks - Improve flashbot() function documentation - Minor code cleanup and formatting improvements * refactor: improve network handling and type safety - Convert Network type to Enum for better type safety - Update FLASHBOTS_NETWORKS to use Network enum as keys - Remove get_networks() function, use Network enum values directly - Add EnumAction class for argparse to handle Network enum - Update parse_arguments() and related functions to use Network enum - Adjust type hints throughout the code to reflect these changes
- Loading branch information
Showing
13 changed files
with
518 additions
and
469 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Ruff | ||
on: [ push, pull_request ] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.5.4 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [--fix] | ||
# Run the formatter. | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit", | ||
"source.organizeImports": "explicit" | ||
}, | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.