From 5e41b92c4f31d6054ec7c169946d2f0085358632 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Tue, 24 Jun 2025 13:26:28 -0700 Subject: [PATCH 1/3] stop ignoring missing imports for mypy --- mypy.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 93ff455..1e9a78a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,6 +1,5 @@ [mypy] files = cats,tests,*.py -ignore_missing_imports = True show_error_codes = True warn_unused_ignores = True From be198be2dab947db5e7f252eac02a1b21b9a6f87 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Tue, 24 Jun 2025 13:44:10 -0700 Subject: [PATCH 2/3] some import fixes --- cats/unwind_the_bag.py | 4 ++-- setup.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cats/unwind_the_bag.py b/cats/unwind_the_bag.py index a94503f..e355ff4 100644 --- a/cats/unwind_the_bag.py +++ b/cats/unwind_the_bag.py @@ -14,11 +14,9 @@ from chia.rpc.wallet_rpc_client import WalletRpcClient from chia.types.announcement import Announcement from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 from chia.types.coin_spend import CoinSpend from chia.util.bech32m import decode_puzzle_hash from chia.util.config import load_config -from chia.util.ints import uint32, uint64 from chia.wallet.cat_wallet.cat_utils import ( CAT_MOD, SpendableCAT, @@ -31,6 +29,8 @@ from chia.wallet.util.tx_config import DEFAULT_COIN_SELECTION_CONFIG, DEFAULT_TX_CONFIG from chia.wallet.wallet_spend_bundle import WalletSpendBundle from chia_rs import G2Element +from chia_rs.sized_bytes import bytes32 +from chia_rs.sized_ints import uint32, uint64 from cats.secure_the_bag import ( TargetCoin, diff --git a/setup.py b/setup.py index 780be4c..2d359f1 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ "pytest-env", "pre-commit==4.1.0; python_version >= '3.9'", "mypy==1.16.0", + "types-setuptools", "ruff>=0.8.1", ] From f763bd5c52ae1f86f7f16ca503f1c077fd061d05 Mon Sep 17 00:00:00 2001 From: Geoff Walmsley Date: Thu, 26 Jun 2025 14:32:04 +0300 Subject: [PATCH 3/3] fix announcements --- cats/unwind_the_bag.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cats/unwind_the_bag.py b/cats/unwind_the_bag.py index e355ff4..37cf703 100644 --- a/cats/unwind_the_bag.py +++ b/cats/unwind_the_bag.py @@ -12,7 +12,6 @@ from chia.rpc.full_node_rpc_client import FullNodeRpcClient from chia.rpc.wallet_request_types import LogIn, PushTX from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.types.announcement import Announcement from chia.types.blockchain_format.program import Program from chia.types.coin_spend import CoinSpend from chia.util.bech32m import decode_puzzle_hash @@ -24,6 +23,7 @@ match_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) +from chia.wallet.conditions import AssertAnnouncement from chia.wallet.lineage_proof import LineageProof from chia.wallet.uncurried_puzzle import uncurry_puzzle from chia.wallet.util.tx_config import DEFAULT_COIN_SELECTION_CONFIG, DEFAULT_TX_CONFIG @@ -286,9 +286,15 @@ async def app( change_ph = decode_puzzle_hash(change_address) # Fees depend on announcements made by secure the bag CATs to ensure they can't be seperated - cat_announcements: list[Announcement] = [] + cat_announcements: list[AssertAnnouncement] = [] for coin_spend in cat_spend.coin_spends: - cat_announcements.append(Announcement(coin_spend.coin.name(), b"$")) + cat_announcements.append( + AssertAnnouncement( + coin_not_puzzle=True, + asserted_origin_id=coin_spend.coin.name(), + asserted_msg=b"$", + ) + ) # Create signed coin spends and change for fees fees_tx = await wallet_client.create_signed_transactions( @@ -394,7 +400,13 @@ async def app( # Fees depend on announcements made by secure the bag CATs to ensure they can't be seperated cat_announcements = [] for coin_spend in bundle_spends: - cat_announcements.append(Announcement(coin_spend.coin.name(), b"$")) + cat_announcements.append( + AssertAnnouncement( + coin_not_puzzle=True, + asserted_origin_id=coin_spend.coin.name(), + asserted_msg=b"$", + ) + ) # Create signed coin spends and change for fees fees_tx = await wallet_client.create_signed_transactions(