Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
257ee14
Port `spend_clawback_coins` to `@marshal`
Quexington Aug 15, 2025
4e7a385
fix tests
Quexington Aug 15, 2025
8252040
fix test again
Quexington Aug 15, 2025
c8a2fa1
how do I keep missing these?
Quexington Aug 18, 2025
c41a5f6
Port `select_coins` to `@marshal`
Quexington Aug 18, 2025
d5f6323
fix tests
Quexington Aug 19, 2025
4a97361
fix test
Quexington Aug 20, 2025
7677d00
Port `get_spendable_coins`
Quexington Aug 22, 2025
d1d1386
Port `get_coin_records_by_names`
Quexington Aug 22, 2025
2463c96
Port `send_notifications` to `@marshal`
Quexington Aug 22, 2025
afb4e9c
Fixing the thing that is always broken
Quexington Aug 25, 2025
fa4d6de
Merge remote-tracking branch 'origin/main' into quex.port_send_notifi…
Quexington Sep 15, 2025
91ede61
Remove accidental import
Quexington Sep 15, 2025
16e4cbd
Port `get_default_cat_list`
Quexington Aug 26, 2025
c84eabd
Port `cat_set_name`
Quexington Aug 26, 2025
04f14eb
Port `cat_get_name`
Quexington Aug 26, 2025
1afd980
Port `get_stray_cats`
Quexington Aug 26, 2025
29d63ae
Port `cat_get_asset_id`
Quexington Aug 26, 2025
4dd9027
Port `cat_asset_id_to_name`
Quexington Aug 26, 2025
8f3908b
Port `check_offer_validity`
Quexington Aug 27, 2025
95a22d9
Port `get_offers_count`
Quexington Aug 27, 2025
eaea78d
Port `cat_spend` to `@marshal`
Quexington Aug 28, 2025
151ce93
fix tests
Quexington Aug 29, 2025
db3a51f
Port `create_offer_for_ids` to `@marshal`
Quexington Sep 10, 2025
81d86e6
Self from typing_extensions
Quexington Sep 10, 2025
424b184
Fix support for "" in PuzzleInfo/Solver
Quexington Sep 10, 2025
e5cb31b
Port `get_offer_summary` to `@marshal`
Quexington Sep 11, 2025
8abfe38
Port `take_offer` to `@marshal`
Quexington Sep 12, 2025
9c3ef2f
`TransactionEndpointRequest` misses
Quexington Sep 12, 2025
53cebb1
Port `get_offer` to `@marshal`
Quexington Sep 12, 2025
9ad6880
Port `get_all_offers` to `@marshal`
Quexington Sep 12, 2025
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
20 changes: 12 additions & 8 deletions chia/_tests/cmds/cmd_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
from chia.wallet.util.tx_config import TXConfig
from chia.wallet.util.wallet_types import WalletType
from chia.wallet.wallet_request_types import (
CATAssetIDToName,
CATAssetIDToNameResponse,
CATGetName,
CATGetNameResponse,
GetSyncStatusResponse,
GetTransaction,
GetTransactionResponse,
Expand Down Expand Up @@ -146,9 +150,9 @@ async def get_transaction(self, request: GetTransaction) -> GetTransactionRespon
bytes32([2] * 32),
)

async def get_cat_name(self, wallet_id: int) -> str:
self.add_to_log("get_cat_name", (wallet_id,))
return "test" + str(wallet_id)
async def get_cat_name(self, request: CATGetName) -> CATGetNameResponse:
self.add_to_log("get_cat_name", (request.wallet_id,))
return CATGetNameResponse(request.wallet_id, "test" + str(request.wallet_id))

async def sign_message_by_address(self, request: SignMessageByAddress) -> SignMessageByAddressResponse:
self.add_to_log("sign_message_by_address", (request.address, request.message))
Expand Down Expand Up @@ -182,15 +186,15 @@ async def sign_message_by_id(self, request: SignMessageByID) -> SignMessageByIDR
signing_mode = SigningMode.CHIP_0002.value
return SignMessageByIDResponse(pubkey, signature, bytes32.zeros, signing_mode)

async def cat_asset_id_to_name(self, asset_id: bytes32) -> Optional[tuple[Optional[uint32], str]]:
async def cat_asset_id_to_name(self, request: CATAssetIDToName) -> CATAssetIDToNameResponse:
"""
if bytes32([1] * 32), return (uint32(2), "test1"), if bytes32([1] * 32), return (uint32(3), "test2")
"""
self.add_to_log("cat_asset_id_to_name", (asset_id,))
self.add_to_log("cat_asset_id_to_name", (request.asset_id,))
for i in range(256):
if asset_id == get_bytes32(i):
return uint32(i + 1), "test" + str(i)
return None
if request.asset_id == get_bytes32(i):
return CATAssetIDToNameResponse(uint32(i + 1), "test" + str(i))
return CATAssetIDToNameResponse(wallet_id=None, name=None)

async def get_nft_info(self, request: NFTGetInfo) -> NFTGetInfoResponse:
self.add_to_log("get_nft_info", (request.coin_id, request.latest))
Expand Down
36 changes: 19 additions & 17 deletions chia/_tests/cmds/wallet/test_notifications.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
from __future__ import annotations

from pathlib import Path
from typing import cast

from chia_rs.sized_bytes import bytes32
from chia_rs.sized_ints import uint32, uint64

from chia._tests.cmds.cmd_test_utils import TestRpcClients, TestWalletRpcClient, logType, run_cli_command_and_assert
from chia._tests.cmds.wallet.test_consts import FINGERPRINT, FINGERPRINT_ARG, get_bytes32
from chia._tests.cmds.wallet.test_consts import FINGERPRINT, FINGERPRINT_ARG, STD_TX, STD_UTX, get_bytes32
from chia.util.bech32m import encode_puzzle_hash
from chia.wallet.conditions import ConditionValidTimes
from chia.wallet.conditions import Condition, ConditionValidTimes
from chia.wallet.notification_store import Notification
from chia.wallet.transaction_record import TransactionRecord
from chia.wallet.wallet_request_types import DeleteNotifications, GetNotifications, GetNotificationsResponse
from chia.wallet.util.tx_config import TXConfig
from chia.wallet.wallet_request_types import (
DeleteNotifications,
GetNotifications,
GetNotificationsResponse,
SendNotification,
SendNotificationResponse,
)

test_condition_valid_times: ConditionValidTimes = ConditionValidTimes(min_time=uint64(100), max_time=uint64(150))

Expand All @@ -26,20 +31,17 @@ def test_notifications_send(capsys: object, get_test_cli_clients: tuple[TestRpcC
class NotificationsSendRpcClient(TestWalletRpcClient):
async def send_notification(
self,
target: bytes32,
msg: bytes,
amount: uint64,
fee: uint64 = uint64(0),
push: bool = True,
request: SendNotification,
tx_config: TXConfig,
extra_conditions: tuple[Condition, ...] = tuple(),
timelock_info: ConditionValidTimes = ConditionValidTimes(),
) -> TransactionRecord:
self.add_to_log("send_notification", (target, msg, amount, fee, push, timelock_info))

class FakeTransactionRecord:
def __init__(self, name: str) -> None:
self.name = name
) -> SendNotificationResponse:
self.add_to_log(
"send_notification",
(request.target, request.message, request.amount, request.fee, request.push, timelock_info),
)

return cast(TransactionRecord, FakeTransactionRecord(get_bytes32(2).hex()))
return SendNotificationResponse([STD_UTX], [STD_TX], tx=STD_TX)

inst_rpc_client = NotificationsSendRpcClient()
test_rpc_clients.wallet_rpc_client = inst_rpc_client
Expand Down
Loading
Loading