mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: election show command displaying the base56 public key
Solution: Cast any public key to base64
This commit is contained in:
parent
faff4d6466
commit
28032b8270
@ -12,7 +12,7 @@ from bigchaindb.common.exceptions import (InvalidSignature,
|
||||
InvalidProposer,
|
||||
UnequalValidatorSet,
|
||||
DuplicateTransaction)
|
||||
from bigchaindb.tendermint_utils import key_from_base64
|
||||
from bigchaindb.tendermint_utils import key_from_base64, public_key_to_base64
|
||||
from bigchaindb.common.crypto import (public_key_from_ed25519_key)
|
||||
from bigchaindb.common.transaction import Transaction
|
||||
from bigchaindb.common.schema import (_validate_schema,
|
||||
@ -231,10 +231,13 @@ class Election(Transaction):
|
||||
|
||||
def show_election(self, bigchain):
|
||||
data = self.asset['data']
|
||||
if 'public_key' in data.keys():
|
||||
data['public_key'] = public_key_to_base64(data['public_key']['value'])
|
||||
response = ''
|
||||
for k, v in data.items():
|
||||
if k != 'seed':
|
||||
response += f'{k}={v}\n'
|
||||
response += self.get_status(bigchain)
|
||||
response += f'status={self.get_status(bigchain)}'
|
||||
|
||||
return response
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user