Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Update use of leaves as iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Schwarz <pschwarz@bitwise.io>
  • Loading branch information
peterschwarz committed May 1, 2018
1 parent 7b40f34 commit 75e1046
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_validators(self):
leaves = self._state_view.leaves(_NAMESPACE)
infos = [
ValidatorRegistryView._parse_validator_info(state_data)
for address, state_data in leaves.items()
for address, state_data in leaves
if address != validator_map_addr
]
return {info.id: info for info in infos}
Expand Down
4 changes: 2 additions & 2 deletions common/tests/test_validator_registry_view/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def addresses(self):

def leaves(self, prefix):
"""See sawtooth_validator.state.state_view.StateView.leaves"""
return {
return ({
address: data
for address, data in self._state.items()
if address.startswith(prefix)
}
}).items()

0 comments on commit 75e1046

Please sign in to comment.