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 :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), 'public_key': {'value': public_key_from_base64(args.public_key),
'type': 'ed25519-base16'}, 'type': 'ed25519-base16'},
'power': args.power, 'power': args.power,
'node_id': args.node_id 'node_id': args.node_id
} }]
return create_new_election(args.sk, planet, ValidatorElection, new_validator) 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) planet.store_election(self.id, height, is_concluded)
def show_election(self, planet): def show_election(self, planet):
data = self.asset['data'] data = self.assets[0]['data']
if 'public_key' in data.keys(): if 'public_key' in data.keys():
data['public_key'] = public_key_to_base64(data['public_key']['value']) data['public_key'] = public_key_to_base64(data['public_key']['value'])
response = '' response = ''

View File

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