Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hint to CAT change #15179

Merged
merged 5 commits into from
May 4, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion chia/wallet/cat_wallet/cat_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ async def generate_unsigned_spendbundle(
break
else:
change_puzhash = await self.get_new_inner_hash()
primaries.append(Payment(change_puzhash, uint64(change)))
primaries.append(Payment(change_puzhash, uint64(change), [change_puzhash]))

# Loop through the coins we've selected and gather the information we need to spend them
spendable_cat_list = []
Expand Down
6 changes: 3 additions & 3 deletions tests/wallet/cat_wallet/test_cat_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async def test_cat_spend(self, self_hostname, two_wallet_nodes, trusted):

await time_out_assert(20, cat_wallet.get_pending_change_balance, 40)
memos = await api_0.get_transaction_memo(dict(transaction_id=tx_id))
assert len(memos[tx_id]) == 1
assert len(memos[tx_id]) == 2 # One for tx, one for change
assert list(memos[tx_id].values())[0][0] == cat_2_hash.hex()

for i in range(1, num_blocks):
Expand All @@ -222,7 +222,7 @@ async def test_cat_spend(self, self_hostname, two_wallet_nodes, trusted):
coin = coins.pop()
tx_id = coin.name().hex()
memos = await api_1.get_transaction_memo(dict(transaction_id=tx_id))
assert len(memos[tx_id]) == 1
assert len(memos[tx_id]) == 2
assert list(memos[tx_id].values())[0][0] == cat_2_hash.hex()
cat_hash = await cat_wallet.get_new_inner_hash()
tx_records = await cat_wallet_2.generate_signed_transaction([uint64(15)], [cat_hash])
Expand Down Expand Up @@ -605,7 +605,7 @@ async def test_cat_spend_multiple(self, self_hostname, three_wallet_nodes, trust
for tx in txs:
if tx.amount == 30:
memos = tx.get_memos()
assert len(memos) == 1
assert len(memos) == 2 # One for tx, one for change
assert b"Markus Walburg" in [v for v_list in memos.values() for v in v_list]
assert list(memos.keys())[0] in [a.name() for a in tx.spend_bundle.additions()]

Expand Down