Repository: Chia-Network/chia-blockchain
File: chia/_tests/wallet/test_wallet.py (Python)

Code before:
                            "pending_coin_removal_count": -2,
                        }
                    },
                ),
                WalletStateTransition(
                    pre_block_balance_updates={},
                    post_block_balance_updates={},
                ),
            ]
        )
        await time_out_assert(20, wsm.coin_store.count_small_unspent, 0, 1000, CoinType.CLAWBACK)

        txs = await api_0.get_transactions(
            dict(
                type_filter={
                    "values": [TransactionType.INCOMING_CLAWBACK_SEND.value, TransactionType.OUTGOING_CLAWBACK.value],
                    "mode": 1,
                },
                wallet_id=1,
            )
        )
        assert len(txs["transactions"]) == 2
        assert txs["transactions"][0]["confirmed"]
        assert txs["transactions"][1]["confirmed"]
        assert txs["transactions"][0]["memos"] != txs["transactions"][1]["memos"]
        assert next(iter(txs["transactions"][0]["memos"].values())) == b"Test".hex()

    @pytest.mark.parametrize(
        "wallet_environments",
        [{"num_environments": 2, "blocks_needed": [1, 1], "reuse_puzhash": True}],
        indirect=True,
    )
    @pytest.mark.limit_consensus_modes(reason="irrelevant")
    @pytest.mark.anyio
    async def test_wallet_clawback_claim_manual(self, wallet_environments: WalletTestFramework) -> None:
        env = wallet_environments.environments[0]
        env_2 = wallet_environments.environments[1]
        wsm = env.wallet_state_manager
        wsm_2 = env_2.wallet_state_manager
        wallet = env.xch_wallet
        wallet_1 = env_2.xch_wallet
        api_0 = env.rpc_api
        api_1 = env_2.rpc_api

        tx_amount = 500
        async with wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
            normal_puzhash = await action_scope.get_puzzle_hash(wallet_1.wallet_state_manager)
        # Transfer to normal wallet
        async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
            await wallet.generate_signed_transaction(
                [uint64(tx_amount)],

Review comment (suggestion):
i think?  maybe?

```suggestion
        assert "0x" + b"Test".hex() in txs["transactions"][0]["memos"].values()
```

Code after:
                            "pending_coin_removal_count": -2,
                        }
                    },
                ),
                WalletStateTransition(
                    pre_block_balance_updates={},
                    post_block_balance_updates={},
                ),
            ]
        )
        await time_out_assert(20, wsm.coin_store.count_small_unspent, 0, 1000, CoinType.CLAWBACK)

        txs = await api_0.get_transactions(
            dict(
                type_filter={
                    "values": [TransactionType.INCOMING_CLAWBACK_SEND.value, TransactionType.OUTGOING_CLAWBACK.value],
                    "mode": 1,
                },
                wallet_id=1,
            )
        )
        assert len(txs["transactions"]) == 2
        assert txs["transactions"][0]["confirmed"]
        assert txs["transactions"][1]["confirmed"]
        assert txs["transactions"][0]["memos"] != txs["transactions"][1]["memos"]
        assert "0x" + b"Test".hex() in next(iter(txs["transactions"][0]["memos"].values()))

    @pytest.mark.parametrize(
        "wallet_environments",
        [{"num_environments": 2, "blocks_needed": [1, 1], "reuse_puzhash": True}],
        indirect=True,
    )
    @pytest.mark.limit_consensus_modes(reason="irrelevant")
    @pytest.mark.anyio
    async def test_wallet_clawback_claim_manual(self, wallet_environments: WalletTestFramework) -> None:
        env = wallet_environments.environments[0]
        env_2 = wallet_environments.environments[1]
        wsm = env.wallet_state_manager
        wsm_2 = env_2.wallet_state_manager
        wallet = env.xch_wallet
        wallet_1 = env_2.xch_wallet
        api_0 = env.rpc_api
        api_1 = env_2.rpc_api

        tx_amount = 500
        async with wallet_1.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
            normal_puzhash = await action_scope.get_puzzle_hash(wallet_1.wallet_state_manager)
        # Transfer to normal wallet
        async with wallet.wallet_state_manager.new_action_scope(DEFAULT_TX_CONFIG, push=True) as action_scope:
            await wallet.generate_signed_transaction(
                [uint64(tx_amount)],