1
1
from __future__ import annotations
2
2
3
+ from asyncio .locks import Condition
3
4
from pathlib import Path
4
- from typing import cast
5
5
6
6
from chia_rs .sized_bytes import bytes32
7
7
from chia_rs .sized_ints import uint32 , uint64
8
8
9
9
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
11
11
from chia .util .bech32m import encode_puzzle_hash
12
12
from chia .wallet .conditions import ConditionValidTimes
13
13
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
+ )
16
22
17
23
test_condition_valid_times : ConditionValidTimes = ConditionValidTimes (min_time = uint64 (100 ), max_time = uint64 (150 ))
18
24
@@ -26,20 +32,17 @@ def test_notifications_send(capsys: object, get_test_cli_clients: tuple[TestRpcC
26
32
class NotificationsSendRpcClient (TestWalletRpcClient ):
27
33
async def send_notification (
28
34
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 (),
34
38
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
+ )
41
44
42
- return cast ( TransactionRecord , FakeTransactionRecord ( get_bytes32 ( 2 ). hex ()) )
45
+ return SendNotificationResponse ([ STD_UTX ], [ STD_TX ], tx = STD_TX )
43
46
44
47
inst_rpc_client = NotificationsSendRpcClient ()
45
48
test_rpc_clients .wallet_rpc_client = inst_rpc_client
0 commit comments