Closed marekyggdrasil closed 3 years ago
grin-wallet owner_api
Password:
20201220 07:55:46.473 WARN grin_wallet_controller::controller - Starting HTTP Foreign API on Owner server at 127.0.0.1:3420.
20201220 07:55:46.473 WARN grin_wallet_controller::controller - Starting HTTP Owner API server at 127.0.0.1:3420.
20201220 07:55:46.473 WARN grin_wallet_controller::controller - HTTP Owner listener started
HTTP Owner successfully started.
wallet.open_wallet("newaccount", wallet_password) wallet.set_active_account("newaccount") proof=wallet.retrieve_payment_proof(tx_id=18) pp.pprint("the following is your payment proof for tx_id=18") pp.pprint(proof)
'the following is your payment proof for tx_id=18'
{ 'amount': '1000000000',
'excess': '08e22384e7ee97bd12d96998dc0e19cec66dd8a505bbeb1ae47ba2b4697ba9052f',
'recipient_address': 'grin12wktxlyfx62wx48ldn55katd8zm5d6qfa6mupt9r4uul8eqxagsqct3je5',
'recipient_sig': 'acf6a6a68ea5dfa79d53362a47d308303ce418c6e794e64370408bf7fe132d34b427a40195bf98011b608ea167d8681765ea64560cdd17b6fe0ef604d406d008',
'sender_address': 'grin1jdj2w0fh8haq9pfuvjmjrev5f4gs34n4n7fnsfmuwf7j09x4v9ws79nq8d',
'sender_sig': '28b88abb62d67e119531046fe8953b6d9ee02c03f87157d57433a334dcdb838f6b968c1facd52d6bafbec783a935de815d10534fc700bfd700f4e009ee323f01'}
wallet.set_active_account("default") pp.pprint("verify the proof as a receiver") pp.pprint(wallet.verify_payment_proof(proof))
'verify the proof as a receiver'
[False, True]
Proof of payment seems to be valid
Payment proof as well as verification of sender and recipient (booleans) look good. Thanks for great work! Closing.
Description Testing the verify payment proof method from the Owner API
Prerequisites
Test procedure
Expected result:
Check if verifies a PaymentProof This process entails:
This function also checks whether the sender or recipient address belongs to the currently open wallet, and returns 2 booleans indicating whether the address belongs to the sender and whether the address belongs to the recipient respectively.
Provide requests and response full payloads as well as wallet and node logs.
Include the output of command
and your environment