mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-26 23:45:47 +00:00
fixed some test cases
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
98d0533219
commit
ca4cc3429a
@ -156,13 +156,12 @@ def run_election_new_upsert_validator(args, planet):
|
||||
:return: election_id or `False` in case of failure
|
||||
"""
|
||||
|
||||
# TODO: check if this change reflects assets correctly
|
||||
new_validator = [{
|
||||
new_validator = {
|
||||
'public_key': {'value': public_key_from_base64(args.public_key),
|
||||
'type': 'ed25519-base16'},
|
||||
'power': args.power,
|
||||
'node_id': args.node_id
|
||||
}]
|
||||
}
|
||||
|
||||
return create_new_election(args.sk, planet, ValidatorElection, new_validator)
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ class ValidatorElection(Election):
|
||||
super(ValidatorElection, self).validate(planet, current_transactions=current_transactions)
|
||||
|
||||
# NOTE: change more than 1/3 of the current power is not allowed
|
||||
if self.asset['data']['power'] >= (1 / 3) * sum(current_validators.values()):
|
||||
if self.assets[0]['data']['power'] >= (1 / 3) * sum(current_validators.values()):
|
||||
raise InvalidPowerChange('`power` change must be less than 1/3 of total power')
|
||||
|
||||
return self
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user