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']
Loading
Please sign in to comment