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

Chia-Network / chia-blockchain / 23763249263
91%

Build:
DEFAULT BRANCH: main
Ran 30 Mar 2026 09:13PM UTC
Jobs 1
Files 902
Run time 2min
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

30 Mar 2026 07:21PM UTC coverage: 91.165% (-0.06%) from 91.225%
23763249263

push

github

web-flow
mypy: remove exclusion for chia.wallet.key_val_store (#20618)

### Purpose:

Remove `chia.wallet.key_val_store` from the mypy strict-mode exclusion
list by adding full type annotations. Also fixes a pre-existing bug in
`WalletBlockchain.create()` where DB-persisted `SUB_SLOT_ITERS` and
`DIFFICULTY` values were silently discarded. This does not introduce a
breaking change.

### Current Behavior:

- `chia.wallet.key_val_store` is excluded from mypy strict checking. The
`KeyValStore` methods use `Any` for `object_type` and `obj` parameters,
and `create`, `set_object`, and `remove_object` lack return type
annotations.
- `WalletBlockchain.create()` loads `SUB_SLOT_ITERS` and `DIFFICULTY`
from the key-value store, but unconditionally overwrites them with
`constants.SUB_SLOT_ITERS_STARTING` and `constants.DIFFICULTY_STARTING`
a few lines later, making the DB reads dead stores.

### New Behavior:

- Define a `_Serializable` Protocol capturing the
`from_bytes`/`stream_to_bytes` interface used by all stored types
(`Streamable` subclasses, `uint32`, `uint64`, etc.).
- `get_object` is now generic: `(key: str, object_type: type[_T]) -> _T
| None` where `_T` is bound to `_Serializable`.
- `set_object` annotates `obj` as `_Serializable` instead of `Any`, with
`-> None`.
- `create` returns `Self`; `remove_object` returns `None`.
- Fix downstream `assignment` errors in `wallet_blockchain.py` where
`get_object` now correctly returns `T | None` — uses temporary variables
with `None` defaults.
- Remove the unconditional overwrites of `_sub_slot_iters` and
`_difficulty` in `WalletBlockchain.create()`, so DB-persisted values are
preserved when available, falling back to starting constants only when
the store returns `None`.
- Remove `chia.wallet.key_val_store` from `mypy-exclusions.txt`.

### Testing Notes:

- `pre-commit run mypy --all-files` passes (936 source files checked,
zero errors).
- `ruff check` and `ruff format --check` pass on all changed files.
- `test_wallet_... (continued)

10475 of 11664 branches covered (89.81%)

Branch coverage included in aggregate %.

39 of 39 new or added lines in 3 files covered. (100.0%)

80 existing lines in 28 files now uncovered.

106421 of 116560 relevant lines covered (91.3%)

1.83 hits per line

Coverage Regressions

Lines Coverage ∆ File
22
77.42
-11.52% chia/_tests/core/util/test_lockfile.py
6
80.73
-1.04% chia/server/node_discovery.py
6
89.04
-8.22% chia/_tests/core/server/test_event_loop.py
5
81.48
-12.96% chia/introducer/introducer_api.py
5
86.83
-0.15% chia/wallet/wallet_node.py
4
87.45
-0.09% chia/full_node/full_node.py
3
86.75
-0.21% chia/full_node/full_node_api.py
3
96.27
-0.93% chia/simulator/setup_services.py
2
95.55
-0.17% chia/data_layer/data_store.py
2
98.57
-0.57% chia/full_node/coin_store.py
2
96.58
-1.03% chia/util/db_wrapper.py
2
98.23
-0.71% chia/util/file_keyring.py
2
91.23
-3.51% chia/util/files.py
2
81.82
-13.64% chia/util/json_util.py
1
85.42
-0.34% chia/cmds/plotnft_funcs.py
1
85.92
0.12% chia/data_layer/data_layer.py
1
96.88
-0.28% chia/full_node/block_store.py
1
81.9
-0.86% chia/introducer/introducer.py
1
90.94
-0.31% chia/rpc/rpc_server.py
1
89.43
-0.23% chia/seeder/dns_server.py
1
94.52
-0.68% chia/server/chia_policy.py
1
99.82
-0.06% chia/_tests/core/mempool/test_mempool_manager.py
1
99.42
-0.58% chia/_tests/rpc/test_rpc_server.py
1
96.49
-0.32% chia/_tests/simulation/test_simulation.py
1
93.02
-0.78% chia/timelord/timelord_api.py
1
71.43
-0.71% chia/timelord/timelord_launcher.py
1
94.48
-0.05% chia/wallet/wallet_state_manager.py
1
98.18
-1.82% chia/wallet/wallet_user_store.py
Jobs
ID Job ID Ran Files Coverage
1 23763249263.1 30 Mar 2026 09:13PM UTC 1804
91.17
GitHub Action Run
Source Files on build 23763249263
  • Tree
  • List 902
  • Changed 33
  • Source Changed 3
  • Coverage Changed 33
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #23763249263
  • 981d363d on github
  • Prev Build on main (#23747503465)
  • Next Build on main (#23770545033)
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