Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #267 from lzpap/is_promotable_return_type
Browse files Browse the repository at this point in the history
Fine-tune is_promotable response dictionary
  • Loading branch information
lzpap committed Nov 19, 2019
2 parents 2e73a66 + 7c647c4 commit 6090958
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions iota/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,8 @@ def is_promotable(
'info': Optional(List[Text])
If `promotable` is ``False``, this contains info about what
went wrong.
Note that when 'promotable' is ``True``, 'info' does not
exist.
}
Expand Down
3 changes: 2 additions & 1 deletion iota/commands/extended/is_promotable.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def _execute(self, request):
response['promotable'] = response['promotable'] and is_within

# If there are no problems, we don't need 'info' field
# Delete info field to make it consistent with check_consistency repsonse.
if response['promotable']:
response['info'] = None
del response['info']

return response

Expand Down
1 change: 0 additions & 1 deletion test/commands/extended/is_promotable_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def test_happy_path(self):

{
'promotable': True,
'info': None,
}
)

Expand Down

0 comments on commit 6090958

Please sign in to comment.