-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add decode data method in Tx Service Api #1007
Conversation
Pull Request Test Coverage Report for Build 9304382134Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9345962607Details
💛 - Coveralls |
gnosis/safe/api/transaction_service_api/transaction_service_api.py
Outdated
Show resolved
Hide resolved
|
||
:param data: tx data as a 0x prefixed hexadecimal string. | ||
:param to_address: address of the receiving contract | ||
:return: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you returning? Maybe you can define a TypedDict (inside a file entities.py
on the transaction_service_api/
folder) to make clear what's the return value. And we should do the same for other functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I did this by looking at the other methods, but it is not the right thing to do. I will try to update the other method signatures.
"0x095ea7b3000000000000000000000000e6fc577e87f7c977c4393300417dcc592d90acf8ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" | ||
) | ||
to_address = "0x4127839cdf4F73d9fC9a2C2861d8d1799e9DF40C" | ||
self.transaction_service_api.decode_data(data, to_address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not checking the function is returning anything. I could change return response.json()
in decode_data
function to return None
at the end and this test will pass. You should also mock the result and check the function is returning what you expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job
Closes #1006