Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions cats/unwind_the_bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
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.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,
construct_cat_puzzle,
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
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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[mypy]
files = cats,tests,*.py
ignore_missing_imports = True
show_error_codes = True
warn_unused_ignores = True

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down