Commit cfb1b88d authored by Piotr Batko's avatar Piotr Batko
Browse files

Return from wallet API calls only result field

Response from wallet after API call looks like this:

{
  "id": 0,
  "result": [
    <some interesting information>
  ]
}

In the vast majority of cases TestTools users needs only <some interesting
information>. So tests contains a lot of boilerplate code:

result0 = wallet.api.some_call()['result']
result1 = wallet.api.some_other_call()['result']

Everytime tester needs to fetch 'result' field. This commit changes default
behavior to return only 'result' field. So above code will be simplified to
following form:

result0 = wallet.api.some_call()
result1 = wallet.api.some_other_call()

If someone will need to read 'id' field, they can do:
id_ = wallet.api.some_call(only_result=False)['id']
parent f82aa6e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment