45
45
CancelOfferResponse ,
46
46
CATSpendResponse ,
47
47
CreateOfferForIDsResponse ,
48
+ DeleteUnconfirmedTransactions ,
49
+ ExtendDerivationIndex ,
50
+ ExtendDerivationIndexResponse ,
48
51
FungibleAsset ,
52
+ GetCurrentDerivationIndexResponse ,
49
53
GetHeightInfoResponse ,
54
+ GetNextAddress ,
55
+ GetNextAddressResponse ,
50
56
GetTransaction ,
51
57
GetTransactions ,
52
58
GetTransactionsResponse ,
@@ -493,11 +499,11 @@ def test_get_address(capsys: object, get_test_cli_clients: tuple[TestRpcClients,
493
499
494
500
# set RPC Client
495
501
class GetAddressWalletRpcClient (TestWalletRpcClient ):
496
- async def get_next_address (self , wallet_id : int , new_address : bool ) -> str :
497
- self .add_to_log ("get_next_address" , (wallet_id , new_address ))
498
- if new_address :
499
- return encode_puzzle_hash (get_bytes32 (3 ), "xch" )
500
- return encode_puzzle_hash (get_bytes32 (4 ), "xch" )
502
+ async def get_next_address (self , request : GetNextAddress ) -> GetNextAddressResponse :
503
+ self .add_to_log ("get_next_address" , (request . wallet_id , request . new_address ))
504
+ if request . new_address :
505
+ return GetNextAddressResponse ( request . wallet_id , encode_puzzle_hash (get_bytes32 (3 ), "xch" ) )
506
+ return GetNextAddressResponse ( request . wallet_id , encode_puzzle_hash (get_bytes32 (4 ), "xch" ) )
501
507
502
508
inst_rpc_client = GetAddressWalletRpcClient ()
503
509
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -569,8 +575,8 @@ def test_del_unconfirmed_tx(capsys: object, get_test_cli_clients: tuple[TestRpcC
569
575
570
576
# set RPC Client
571
577
class UnconfirmedTxRpcClient (TestWalletRpcClient ):
572
- async def delete_unconfirmed_transactions (self , wallet_id : int ) -> None :
573
- self .add_to_log ("delete_unconfirmed_transactions" , (wallet_id ,))
578
+ async def delete_unconfirmed_transactions (self , request : DeleteUnconfirmedTransactions ) -> None :
579
+ self .add_to_log ("delete_unconfirmed_transactions" , (request . wallet_id ,))
574
580
575
581
inst_rpc_client = UnconfirmedTxRpcClient ()
576
582
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -594,9 +600,9 @@ def test_get_derivation_index(capsys: object, get_test_cli_clients: tuple[TestRp
594
600
595
601
# set RPC Client
596
602
class GetDerivationIndexRpcClient (TestWalletRpcClient ):
597
- async def get_current_derivation_index (self ) -> str :
603
+ async def get_current_derivation_index (self ) -> GetCurrentDerivationIndexResponse :
598
604
self .add_to_log ("get_current_derivation_index" , ())
599
- return str ( 520 )
605
+ return GetCurrentDerivationIndexResponse ( uint32 ( 520 ) )
600
606
601
607
inst_rpc_client = GetDerivationIndexRpcClient ()
602
608
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -625,8 +631,9 @@ def test_sign_message(capsys: object, get_test_cli_clients: tuple[TestRpcClients
625
631
# these are various things that should be in the output
626
632
assert_list = [
627
633
f"Message: { message .hex ()} " ,
628
- f"Public Key: { bytes ([3 ] * 48 ).hex ()} " ,
629
- f"Signature: { bytes ([6 ] * 576 ).hex ()} " ,
634
+ "Public Key: b5acf3599bc5fa5da1c00f6cc3d5bcf1560def67778b7f50a8c373a83f78761505b6250ab776e38a292e26628009aec4" ,
635
+ "Signature: c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
636
+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ,
630
637
f"Signing Mode: { SigningMode .CHIP_0002 .value } " ,
631
638
]
632
639
run_cli_command_and_assert (capsys , root_dir , [* command_args , f"-a{ xch_addr } " ], assert_list )
@@ -641,9 +648,9 @@ def test_update_derivation_index(capsys: object, get_test_cli_clients: tuple[Tes
641
648
642
649
# set RPC Client
643
650
class UpdateDerivationIndexRpcClient (TestWalletRpcClient ):
644
- async def extend_derivation_index (self , index : int ) -> str :
645
- self .add_to_log ("extend_derivation_index" , (index ,))
646
- return str ( index )
651
+ async def extend_derivation_index (self , request : ExtendDerivationIndex ) -> ExtendDerivationIndexResponse :
652
+ self .add_to_log ("extend_derivation_index" , (request . index ,))
653
+ return ExtendDerivationIndexResponse ( request . index )
647
654
648
655
inst_rpc_client = UpdateDerivationIndexRpcClient ()
649
656
test_rpc_clients .wallet_rpc_client = inst_rpc_client
0 commit comments