-
Notifications
You must be signed in to change notification settings - Fork 124
Update the core commands to match the latest IRI 1.8.1 release #236
Conversation
I usually like it to clean up code that I touch. Since making the code PEP8 conform is still work in progress I changed the indentation level to 4 spaces in existing test files where I added more tests. That is the reason why this pull request has quite a lot of line changes. If its preferred to have these changes in a separate ticket/pull request let me know and I can change it back to 2 spaces. |
|
||
class GetBalancesResponseFilter(ResponseFilter): | ||
def __init__(self): | ||
super(GetBalancesResponseFilter, self).__init__({ | ||
'balances': f.Array | f.FilterRepeater(f.Int), | ||
|
||
'milestone': | ||
f.ByteString(encoding='ascii') | Trytes(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.
Note that this is a potential backwards incompatible change. milestone
was removed in IRI version 1.4.1.6 (https://github.com/iotaledger/iri/blob/v1.4.1.6/src/main/java/com/iota/iri/service/dto/GetBalancesResponse.java) which was released on the 6th of January 2018. Since this was more than one and a half years ago I think it is justified to remove it here too.
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.
👍🏻 Sounds good to me.
Hi @pdecol thanks for working on this! Really appreciate the attention to detail and being proactive about keeping the codebase consistent! Will have a look at this today 👍🏻 |
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.
amazing, thank you for your contribution :)
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.
|
||
class GetBalancesResponseFilter(ResponseFilter): | ||
def __init__(self): | ||
super(GetBalancesResponseFilter, self).__init__({ | ||
'balances': f.Array | f.FilterRepeater(f.Int), | ||
|
||
'milestone': | ||
f.ByteString(encoding='ascii') | Trytes(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.
👍🏻 Sounds good to me.
Hey @todofixthis I will start with coordinating with the other libs to see if they validate requests/responses. I am generally for filters in both directions. Then you could handle exceptions and also it might be easier to reveal bugs with future IRI API changes. |
@todofixthis I talked with the devs of the other libraries, and the conclusion is that responses are not filtered/validated/checked in general, except bundle and transactions hashes. I think it would be nice to make PyOTA consistent with this behavior. |
Thanks for the review! I implemented the requested changes and reverted the changes to the response filters for the fields that we decided not to validate. |
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.
Two more changes requested; apologies for not bringing them up during the first review. Once these last two items are addressed, this is good to go!
No worries. Thanks for spotting this mistake. I removed One more thing that I would like to ask you. Can you change this URL here in GitHub? (https://iota.readme.io/ -> https://docs.iota.org/) I think this should be the very last URL that needs to be adjusted. |
LGTM Thanks @pdecol !! |
Thanks @pdecol ! |
resolves #235