• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-eth-py / 26747417174
94%

Build:
DEFAULT BRANCH: main
Ran 01 Jun 2026 09:49AM UTC
Jobs 1
Files 120
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Jun 2026 09:45AM UTC coverage: 94.102% (-0.04%) from 94.144%
26747417174

push

github

web-flow
fix: EthereumClient bugfixes and small optimizations (#2505)

* fix: EthereumClient bugfixes and small optimizations

Review of `safe_eth/eth/ethereum_client.py` — the most used module across
the Python services. Bug fixes plus a few low-risk cleanups, public
contract preserved.

Bugfixes:
- `raw_batch_request`: zip used full `payload` instead of `payload_chunk`,
  so error messages from second+ chunks referenced the wrong query.
- `BatchCallManager.batch_call_custom`: `payloads` typed as `Iterable`
  was consumed twice — passing a generator silently produced an empty
  result list. Materialize to list at entry. Added missing
  `len(results) == len(chunk)` validation against partial responses.
- `send_unsigned_transaction`: `number_errors` only decremented in the
  `InvalidNonce` branch; `ReplacementTransactionUnderpriced` could loop
  forever.
- `batch_call_same_function`: mutated the caller's
  `contract_function.address` to NULL_ADDRESS and never restored it.
- `get_auto_ethereum_client`: docstring said ETHEREUM_RPC_RETRY_COUNT
  defaulted to 60, code uses 1.
- `multicall` property: typed as `"Multicall"` but returns `None` when
  the network is unsupported. Now `Optional["Multicall"]`.
- `_decode_transfer_log` 1-topic branch: returned non-checksummed
  `from`/`to`, unlike every other branch.

Optimizations / cleanup:
- `estimate_data_gas`: byte-by-byte Python loop → `data.count(0)`
  arithmetic.
- `tx_with_exception_handling`: keys of the reason dict are
  pre-lowercased at decoration time, not on every call.
- `_decode_transfer_log`: added the missing `topics_len == 2` case;
  3/4-topic branches now decode topic bytes directly (`topics[i][-20:]`,
  `int.from_bytes`) instead of concatenating and calling `eth_abi.decode`
  with composite types.
- `batch_call`: dropped unused `enumerate`.
- `batch_call_custom` / `batch_call_same_function`: `assert` →
  `raise ValueError` so validation survives `python -O`.

Refs PLA-1544

* fix: reject non-address t... (continued)

23 of 28 new or added lines in 1 file covered. (82.14%)

1 existing line in 1 file now uncovered.

10370 of 11020 relevant lines covered (94.1%)

0.94 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
85.09
-0.47% safe_eth/eth/ethereum_client.py

Coverage Regressions

Lines Coverage ∆ File
1
87.18
-1.28% safe_eth/eth/tests/clients/test_etherscan_client_v2.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.13 - 26747417174.1 01 Jun 2026 09:49AM UTC 120
94.1
GitHub Action Run
Source Files on build 26747417174
  • Tree
  • List 120
  • Changed 5
  • Source Changed 4
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26747417174
  • 3b571c82 on github
  • Prev Build on main (#26634218166)
  • Next Build on main (#26763371460)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc