46
46
CATSpendResponse ,
47
47
ClawbackPuzzleDecoratorOverride ,
48
48
CreateOfferForIDsResponse ,
49
+ DeleteUnconfirmedTransactions ,
50
+ ExtendDerivationIndex ,
51
+ ExtendDerivationIndexResponse ,
49
52
FungibleAsset ,
53
+ GetCurrentDerivationIndexResponse ,
50
54
GetHeightInfoResponse ,
55
+ GetNextAddress ,
56
+ GetNextAddressResponse ,
51
57
GetTransaction ,
52
58
GetTransactions ,
53
59
GetTransactionsResponse ,
@@ -500,11 +506,11 @@ def test_get_address(capsys: object, get_test_cli_clients: tuple[TestRpcClients,
500
506
501
507
# set RPC Client
502
508
class GetAddressWalletRpcClient (TestWalletRpcClient ):
503
- async def get_next_address (self , wallet_id : int , new_address : bool ) -> str :
504
- self .add_to_log ("get_next_address" , (wallet_id , new_address ))
505
- if new_address :
506
- return encode_puzzle_hash (get_bytes32 (3 ), "xch" )
507
- return encode_puzzle_hash (get_bytes32 (4 ), "xch" )
509
+ async def get_next_address (self , request : GetNextAddress ) -> GetNextAddressResponse :
510
+ self .add_to_log ("get_next_address" , (request . wallet_id , request . new_address ))
511
+ if request . new_address :
512
+ return GetNextAddressResponse ( request . wallet_id , encode_puzzle_hash (get_bytes32 (3 ), "xch" ) )
513
+ return GetNextAddressResponse ( request . wallet_id , encode_puzzle_hash (get_bytes32 (4 ), "xch" ) )
508
514
509
515
inst_rpc_client = GetAddressWalletRpcClient ()
510
516
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -576,8 +582,8 @@ def test_del_unconfirmed_tx(capsys: object, get_test_cli_clients: tuple[TestRpcC
576
582
577
583
# set RPC Client
578
584
class UnconfirmedTxRpcClient (TestWalletRpcClient ):
579
- async def delete_unconfirmed_transactions (self , wallet_id : int ) -> None :
580
- self .add_to_log ("delete_unconfirmed_transactions" , (wallet_id ,))
585
+ async def delete_unconfirmed_transactions (self , request : DeleteUnconfirmedTransactions ) -> None :
586
+ self .add_to_log ("delete_unconfirmed_transactions" , (request . wallet_id ,))
581
587
582
588
inst_rpc_client = UnconfirmedTxRpcClient ()
583
589
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -601,9 +607,9 @@ def test_get_derivation_index(capsys: object, get_test_cli_clients: tuple[TestRp
601
607
602
608
# set RPC Client
603
609
class GetDerivationIndexRpcClient (TestWalletRpcClient ):
604
- async def get_current_derivation_index (self ) -> str :
610
+ async def get_current_derivation_index (self ) -> GetCurrentDerivationIndexResponse :
605
611
self .add_to_log ("get_current_derivation_index" , ())
606
- return str ( 520 )
612
+ return GetCurrentDerivationIndexResponse ( uint32 ( 520 ) )
607
613
608
614
inst_rpc_client = GetDerivationIndexRpcClient ()
609
615
test_rpc_clients .wallet_rpc_client = inst_rpc_client
@@ -632,8 +638,9 @@ def test_sign_message(capsys: object, get_test_cli_clients: tuple[TestRpcClients
632
638
# these are various things that should be in the output
633
639
assert_list = [
634
640
f"Message: { message .hex ()} " ,
635
- f"Public Key: { bytes ([3 ] * 48 ).hex ()} " ,
636
- f"Signature: { bytes ([6 ] * 576 ).hex ()} " ,
641
+ "Public Key: b5acf3599bc5fa5da1c00f6cc3d5bcf1560def67778b7f50a8c373a83f78761505b6250ab776e38a292e26628009aec4" ,
642
+ "Signature: c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
643
+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ,
637
644
f"Signing Mode: { SigningMode .CHIP_0002 .value } " ,
638
645
]
639
646
run_cli_command_and_assert (capsys , root_dir , [* command_args , f"-a{ xch_addr } " ], assert_list )
@@ -648,9 +655,9 @@ def test_update_derivation_index(capsys: object, get_test_cli_clients: tuple[Tes
648
655
649
656
# set RPC Client
650
657
class UpdateDerivationIndexRpcClient (TestWalletRpcClient ):
651
- async def extend_derivation_index (self , index : int ) -> str :
652
- self .add_to_log ("extend_derivation_index" , (index ,))
653
- return str ( index )
658
+ async def extend_derivation_index (self , request : ExtendDerivationIndex ) -> ExtendDerivationIndexResponse :
659
+ self .add_to_log ("extend_derivation_index" , (request . index ,))
660
+ return ExtendDerivationIndexResponse ( request . index )
654
661
655
662
inst_rpc_client = UpdateDerivationIndexRpcClient ()
656
663
test_rpc_clients .wallet_rpc_client = inst_rpc_client
0 commit comments