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.
Before runnning the script, we need to make sure to edit the configuration.
api_sercet_file = '/Users/path/.grin/main/.owner_api_secret'
wallet_password = 'xxx'
pp.pprint(wallet.retrieve_payment_proof(tx_id=22))
pyhton3 wallet_v3.py
{ 'amount': '0',
'excess': '090807ba55bf1dad1b7e2c4a7c28299788553a384b28d459fb0b0e551e2d5197be',
'recipient_address': 'grin1jdj2w0fh8haq9pfuvjmjrev5f4gs34n4n7fnsfmuwf7j09x4v9ws79nq8d',
'recipient_sig': '19c298481cf59c67bcefeba6f20e441af28962c231809ddeaad73211a2a96d7770512c2fda82840bc920e0838c15e628f64f2b2c8711b1216f2e4d87f67fa200',
'sender_address': 'grin12wktxlyfx62wx48ldn55katd8zm5d6qfa6mupt9r4uul8eqxagsqct3je5',
'sender_sig': 'ec87438010d654bced2b83fd010be600f7f7bb62c345fc8dc148f01a817fe8d8d7db41ca776994c28478385e389d468e65a5f74d6cf89775510116faf62a120d'}
Test was valid. a completed transaction returns a single, exportable PaymentProof.
pp.pprint(wallet.retrieve_payment_proof(tx_id=25))
pyhton3 wallet_v3.py
Traceback (most recent call last):
File "/Users/workstation/Downloads/grin.py", line 462, in <module>
pp.pprint(wallet.retrieve_payment_proof(tx_id=25)
File "/Users/workstation/Downloads/grin.py", line 367, in retrieve_payment_proof
resp = self.post_encrypted('retrieve_payment_proof', params)
File "/Users/workstation/Downloads/grin.py", line 93, in post_encrypted
raise WalletError(method, params, response_json["error"]["code"], response_json["error"]["message"])
__main__.WalletError: Callng retrieve_payment_proof with params {'token': '18a0e424eace8329af64a1ae22197c2afe689d08c4ce30f2122a1a56485213ea', 'refresh_from_node': True, 'tx_id': 25, 'tx_slate_id': None} failed with error code -32099 because: PaymentProofRetrieval: Proof does not contain receiver signature
the function returns an error because no payment proof was retrieved for this incomplete transaction.
@mojitoo I forgot to ask, can you please provide version of wallet that has the owner api listener on?
Description Testing the retrieve payment proof method from the Owner API
Prerequisites
Test procedure
Expected result:
Check if for completed transaction returns a single, exportable PaymentProof from a completed transaction within the wallet. For the incomplete transaction PaymentProof should not be returned. Check if returns an error if neither the tx_id or tx_slate_id argument are provided, or the function will return an error.
Provide requests and response full payloads as well as wallet and node logs.