show election status uses the governance table from now on

show election status maps the asset["data"] object properly

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-01-09 21:28:37 +01:00
parent 51ae9874d6
commit 23731c6d14
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,8 @@ from planetmint.commands.election_types import elections
from planetmint.version import __tm_supported_versions__
from planetmint.config import Config
from planetmint.backend.tarantool.const import TARANT_TABLE_GOVERNANCE
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@ -226,7 +228,7 @@ def run_election_show(args, planet):
:param planet: an instance of Planetmint
"""
election = planet.get_transaction(args.election_id)
election = planet.get_transaction(args.election_id, TARANT_TABLE_GOVERNANCE)
if not election:
logger.error(f"No election found with election_id {args.election_id}")
return

View File

@ -710,6 +710,8 @@ class Planetmint(object):
def show_election_status(self, transaction):
data = transaction.assets[0]
data = data.to_dict()["data"]
if "public_key" in data.keys():
data["public_key"] = public_key_to_base64(data["public_key"]["value"])
response = ""