mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 06:55:45 +00:00
CLEAR FUNCTION + test_validator_update PASSED
This commit is contained in:
parent
e26407f5db
commit
868b7bd4d2
@ -464,11 +464,11 @@ def get_validator_set(connection, height: int = None):
|
|||||||
_validators = space.select()
|
_validators = space.select()
|
||||||
_validators = _validators.data
|
_validators = _validators.data
|
||||||
if height is not None:
|
if height is not None:
|
||||||
_validators = [{"height": validator[1]} for validator in _validators if validator[1] <= height]
|
_validators = [{"height": validator[1], "validators": validator[2]} for validator in _validators if validator[1] <= height]
|
||||||
return next(iter(sorted(_validators, key=lambda k: k["height"])), None)
|
return next(iter(sorted(_validators, key=lambda k: k["height"], reverse=True)), None)
|
||||||
else:
|
else:
|
||||||
_validators = [{"height": validator[1], "validators": validator[2]} for validator in _validators]
|
_validators = [{"height": validator[1], "validators": validator[2]} for validator in _validators]
|
||||||
return next(iter(sorted(_validators, key=lambda k: k["height"])), None)
|
return next(iter(sorted(_validators, key=lambda k: k["height"], reverse=True)), None)
|
||||||
|
|
||||||
|
|
||||||
# @register_query(LocalMongoDBConnection)
|
# @register_query(LocalMongoDBConnection)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user