mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 23:11:09 +00:00
Updated proof_of_stake.py
This commit is contained in:
parent
8b9ff8d4f3
commit
e14f6d5122
|
@ -27,7 +27,7 @@ def choose_validator(validators: list[Validator]) -> Validator:
|
||||||
Validator: The selected validator based on weighted random selection.
|
Validator: The selected validator based on weighted random selection.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
>>> validators = [Validator("Alice", 50), Validator("Bob", 30), Validator("Charlie", 20)]
|
>>> validators = [Validator("Alice", 50), Validator("Bob", 30)]
|
||||||
>>> chosen = choose_validator(validators)
|
>>> chosen = choose_validator(validators)
|
||||||
>>> isinstance(chosen, Validator)
|
>>> isinstance(chosen, Validator)
|
||||||
True
|
True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user