From 4c244e30abc6d55f81a2e8da691ec7cfec36262d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 Oct 2026 17:20:46 +0100 Subject: [PATCH] Annotate debug_spend_bundle.py. --- chia/wallet/util/debug_spend_bundle.py | 9 ++++++--- mypy-exclusions.txt | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/chia/wallet/util/debug_spend_bundle.py b/chia/wallet/util/debug_spend_bundle.py index cb56ab2097..db5950638f 100644 --- a/chia/wallet/util/debug_spend_bundle.py +++ b/chia/wallet/util/debug_spend_bundle.py @@ -1,6 +1,7 @@ from __future__ import annotations -from chia_rs import AugSchemeMPL +from chia_rs import AugSchemeMPL, SpendBundle +from chia_rs.sized_bytes import bytes32 from clvm.operators import KEYWORD_FROM_ATOM from clvm_tools.binutils import disassemble as bu_disassemble @@ -21,7 +22,7 @@ KFA = {v: k for k, v in CONDITIONS.items()} # we may need also to save the `genesis_coin_mod` or its hash -def disassemble(sexp: Program): +def disassemble(sexp: Program) -> str: """ This version of `disassemble` also disassembles condition opcodes like `ASSERT_ANNOUNCEMENT_CONSUMED`. """ @@ -65,7 +66,9 @@ def uncurry_dump(puzzle: Program, prefix: str = "") -> None: recursive_uncurry_dump(puzzle, 1, prefix, UncurriedPuzzle(mod, curried_args)) -def debug_spend_bundle(spend_bundle, agg_sig_additional_data=DEFAULT_CONSTANTS.AGG_SIG_ME_ADDITIONAL_DATA) -> None: +def debug_spend_bundle( + spend_bundle: SpendBundle, agg_sig_additional_data: bytes32 = DEFAULT_CONSTANTS.AGG_SIG_ME_ADDITIONAL_DATA +) -> None: """ Print a lot of useful information about a `SpendBundle` that might help with debugging its clvm. diff --git a/mypy-exclusions.txt b/mypy-exclusions.txt index 50c6129a62..b9640268fa 100644 --- a/mypy-exclusions.txt +++ b/mypy-exclusions.txt @@ -12,7 +12,6 @@ chia.simulator.keyring chia.simulator.wallet_tools chia.ssl.create_ssl chia.types.blockchain_format.program -chia.wallet.util.debug_spend_bundle chia.wallet.util.new_peak_queue chia.wallet.wallet_transaction_store chia._tests.clvm.test_puzzles