-
Notifications
You must be signed in to change notification settings - Fork 25
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 Chain.get_transaction/1 #1189
Add Chain.get_transaction/1 #1189
Conversation
Constants.from_transaction(tx) | ||
|
||
{:error, _} -> | ||
nil |
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.
Currently other Chain
functions raise an error if the result is invalid. In this case you are returning nil which is not coherent with other functions.
We should have an unified way to return error.
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.
- Update all
Chain
functions to returnnil
instead of crashing
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.
- expect instead of stub
* Add Chain.get_transaction/1 * Chain functions return nil instead of crashing * Add mocks to the unit tests * use Mock.expect instead of Mock.stub
Description
Implement
Chain.get_transaction/1
Fixes #1167
Type of change
How Has This Been Tested?
Unit tested
Checklist: