Bugfix: align quick_audit.py wrapper with log_audit.py CLI and env vars - #179
Open
casks-mutters wants to merge 1 commit into
Open
Bugfix: align quick_audit.py wrapper with log_audit.py CLI and env vars#179casks-mutters wants to merge 1 commit into
casks-mutters wants to merge 1 commit into
Conversation
## Summary
`quick_audit.py` is intended as a small convenience wrapper around `log_audit.py`, but currently:
- It passes flags like `--rpc-a`, `--rpc-b`, `--from-block`, `--to-block`, which `log_audit.py` does not accept.
- It reads RPC URLs from `LOG_RPC_A` / `LOG_RPC_B`, whereas `log_audit.py` uses `RPC_A` / `RPC_B` as defaults.
As a result, `quick_audit.py` does not work out-of-the-box.
This PR makes `quick_audit.py` compatible with the actual CLI of `log_audit.py` and aligns environment variable usage.
## Changes
- Update `quick_audit.py` to:
- Read RPC defaults from the same env vars as `log_audit.py` (`RPC_A` / `RPC_B`).
- Call `log_audit.py` using:
- positional args: `from_block`, `to_block`, `address`, `topic0`
- options: `--rpcA` and `--rpcB` (matching `build_parser()`).
- If `address` or `topic0` are omitted, pass `"*"` so that the filters behave as wildcards.
## Rationale
- Makes `quick_audit.py` usable without changing `log_audit.py`.
- Keeps the wrapper small and simple while respecting the main script’s interface.
- Avoids confusion for users who expect the wrapper to “just work”.
## Example
```bash
export RPC_A=https://mainnet.infura.io/v3/your_key
export RPC_B=https://eth.llamarpc.com
python quick_audit.py --from-block 10000000 --to-block 10000100
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
quick_audit.pyis intended as a small convenience wrapper aroundlog_audit.py, but currently:--rpc-a,--rpc-b,--from-block,--to-block, whichlog_audit.pydoes not accept.LOG_RPC_A/LOG_RPC_B, whereaslog_audit.pyusesRPC_A/RPC_Bas defaults.As a result,
quick_audit.pydoes not work out-of-the-box.This PR makes
quick_audit.pycompatible with the actual CLI oflog_audit.pyand aligns environment variable usage.Changes
quick_audit.pyto:log_audit.py(RPC_A/RPC_B).log_audit.pyusing:from_block,to_block,address,topic0--rpcAand--rpcB(matchingbuild_parser()).addressortopic0are omitted, pass"*"so that the filters behave as wildcards.Rationale
quick_audit.pyusable without changinglog_audit.py.Example