Skip to content

Commit afb4e9c

Browse files
committed
Fixing the thing that is always broken
1 parent 2463c96 commit afb4e9c

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

chia/_tests/cmds/wallet/test_notifications.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
from __future__ import annotations
22

3+
from asyncio.locks import Condition
34
from pathlib import Path
4-
from typing import cast
55

66
from chia_rs.sized_bytes import bytes32
77
from chia_rs.sized_ints import uint32, uint64
88

99
from chia._tests.cmds.cmd_test_utils import TestRpcClients, TestWalletRpcClient, logType, run_cli_command_and_assert
10-
from chia._tests.cmds.wallet.test_consts import FINGERPRINT, FINGERPRINT_ARG, get_bytes32
10+
from chia._tests.cmds.wallet.test_consts import FINGERPRINT, FINGERPRINT_ARG, STD_TX, STD_UTX, get_bytes32
1111
from chia.util.bech32m import encode_puzzle_hash
1212
from chia.wallet.conditions import ConditionValidTimes
1313
from chia.wallet.notification_store import Notification
14-
from chia.wallet.transaction_record import TransactionRecord
15-
from chia.wallet.wallet_request_types import DeleteNotifications, GetNotifications, GetNotificationsResponse
14+
from chia.wallet.util.tx_config import TXConfig
15+
from chia.wallet.wallet_request_types import (
16+
DeleteNotifications,
17+
GetNotifications,
18+
GetNotificationsResponse,
19+
SendNotification,
20+
SendNotificationResponse,
21+
)
1622

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

@@ -26,20 +32,17 @@ def test_notifications_send(capsys: object, get_test_cli_clients: tuple[TestRpcC
2632
class NotificationsSendRpcClient(TestWalletRpcClient):
2733
async def send_notification(
2834
self,
29-
target: bytes32,
30-
msg: bytes,
31-
amount: uint64,
32-
fee: uint64 = uint64(0),
33-
push: bool = True,
35+
request: SendNotification,
36+
tx_config: TXConfig,
37+
extra_conditions: tuple[Condition, ...] = tuple(),
3438
timelock_info: ConditionValidTimes = ConditionValidTimes(),
35-
) -> TransactionRecord:
36-
self.add_to_log("send_notification", (target, msg, amount, fee, push, timelock_info))
37-
38-
class FakeTransactionRecord:
39-
def __init__(self, name: str) -> None:
40-
self.name = name
39+
) -> SendNotificationResponse:
40+
self.add_to_log(
41+
"send_notification",
42+
(request.target, request.message, request.amount, request.fee, request.push, timelock_info),
43+
)
4144

42-
return cast(TransactionRecord, FakeTransactionRecord(get_bytes32(2).hex()))
45+
return SendNotificationResponse([STD_UTX], [STD_TX], tx=STD_TX)
4346

4447
inst_rpc_client = NotificationsSendRpcClient()
4548
test_rpc_clients.wallet_rpc_client = inst_rpc_client

0 commit comments

Comments
 (0)