You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync to kth/0.80.0 + full v2 regeneration of py-native bindings
Moves py-native off `kth/0.79.0` and regenerates every Python wrapper
through the v2 generator against the current C-API surface. The PR
bundles three layers of change because they can't land separately
without leaving the tree in a non-building intermediate state:
### 1. Conan + build plumbing
- `conanfile.py` requires `kth/0.80.0` (was `0.79.0`).
- `setup.py` sources list now reflects the full generated surface:
binary + the new chain classes (double_spend_proof / _spender,
get_blocks, get_headers, history_compact / _list, operation /
_list, prefilled_transaction / _list, token_data, utxo / _list)
and the new wallet classes (ec_private, ec_public, hd_private,
hd_public, payment_address_list, wallet_data). The hand-written
`src/chain/history.cpp` is out of `sources` — the generator now
covers that surface via `history_compact` + `history_compact_list`.
`chain.cpp` stays (async-callback bridge to `safe_chain`, doesn't
fit ClassConfig).
- `scripts/build-nix.sh` is a new NixOS-only wrapper: resolves the
`gcc.cc.lib` runtime into `LD_LIBRARY_PATH`, provisions a local
`.venv` so editable installs have a writable prefix, scrubs stale
build / conan artefacts before every run, and runs the pytest
suite at the end (skippable with `--no-tests`). Non-NixOS
developers keep using `scripts/build.sh` unchanged.
### 2. Regenerated surface (~70 files)
Full `generate_capi_v2.py --all --target python --write` run:
- Modified every existing binding to pick up the C-API changes from
kth 0.79→0.80: the `kth_*_mut_t` / `_const_t` handle typedefs
(post the `primitives.h` split), the `*_simple` convention on
flag-aware overloads (`output_pattern_simple`,
`is_standard_simple`), the `leak` / `leak_if_valid` adjustment on
types without `operator bool`, and the owned-copy policy for
scalar-value list accessors.
- Created ~38 new bindings that weren't generated before:
`history_compact{,_list}`, `double_spend_proof{,_spender}`,
`get_blocks`, `get_headers`, `operation{,_list}`,
`prefilled_transaction{,_list}`, `token_data`, `utxo{,_list}` on
the chain side, and `ec_private`, `ec_public`, `hd_private`,
`hd_public`, `payment_address_list`, `wallet_data` on the wallet
side.
- `kth_native.pyi` and `src/module.c` picked up the splice updates
for every class above.
### 3. Hand-fixes in the surviving hand-written wrappers
These are the spots the regen doesn't touch where the C-API
renames broke the build:
- `src/chain/chain.cpp` — `kth_merkleblock_t` →
`kth_merkle_block_mut_t`, `kth_history_compact_list_t` →
`kth_history_compact_list_mut_t`, `kth_stealth_compact_list_t` →
`*_mut_t`, `kth_compact_block_t` → `*_mut_t`,
`kth_wallet_payment_address_construct_from_string` →
`_construct_from_address` (plus `kth_payment_address_t` →
`*_mut_t` to match).
- `src/chain/history.cpp` — list/element handle renames to
`*_mut_t` on every call site. The file is kept for its async
callback methods but is out of `setup.py sources`; the regen
covers the sync surface.
- `src/module.c` — dropped 50 lines of stale PyMethodDef entries
(for merkle_block, history_compact{,_list}, compact_block,
stealth_compact{,_list}, payment_address) that pointed at
pre-regen function names. Every class on that list is now
registered through the AUTO-generated `PyModule_AddFunctions`
block further down.
### Follow-up
Not in this PR: test coverage for the ~30 classes that are newly
generator-driven (double_spend_proof / get_blocks / get_headers /
operation / prefilled_transaction / token_data / utxo /
history_compact / ec_private / ec_public / hd_private / hd_public /
wallet_data, and the matching `_list` types). Those bindings
compile, link and import, and the existing 89 pytest cases still
pass, but end-to-end Python-side tests for the new surface will
land in a follow-up PR.
0 commit comments