fixed some command test cases

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2022-04-13 16:19:59 +02:00
parent d070557639
commit af13a3a6f6
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A
3 changed files with 6 additions and 5 deletions

View File

@ -156,12 +156,13 @@ def run_election_new_upsert_validator(args, planet):
:return: election_id or `False` in case of failure
"""
new_validator = {
# TODO: check if this change reflects assets correctly
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)

View File

@ -239,7 +239,7 @@ class Election(Transaction):
planet.store_election(self.id, height, is_concluded)
def show_election(self, planet):
data = self.asset['data']
data = self.assets[0]['data']
if 'public_key' in data.keys():
data['public_key'] = public_key_to_base64(data['public_key']['value'])
response = ''

View File

@ -265,12 +265,12 @@ def test_run_recover(b, alice, bob):
tx1 = Create.generate([alice.public_key],
[([alice.public_key], 1)],
assets={'cycle': 'hero'},
assets=[{'cycle': 'hero'}],
metadata={'name': 'hohenheim'}) \
.sign([alice.private_key])
tx2 = Create.generate([bob.public_key],
[([bob.public_key], 1)],
assets={'cycle': 'hero'},
assets=[{'cycle': 'hero'}],
metadata={'name': 'hohenheim'}) \
.sign([bob.private_key])