mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Default for show_election not implemented for Election class
Solution: Create a default method that work if all fields in the 'asset[data]' can be displayed without additional formatting
This commit is contained in:
parent
5cde9c8b08
commit
b1c9d7de86
@ -224,6 +224,15 @@ class Election(Transaction):
|
||||
def store_election(cls, bigchain, election, height):
|
||||
bigchain.store_election(height, election)
|
||||
|
||||
def show_election(self, bigchain):
|
||||
data = self.asset['data']
|
||||
response = ''
|
||||
for k, v in data.items():
|
||||
response += f'{k}={v}\n'
|
||||
response += self.get_status(bigchain)
|
||||
|
||||
return response
|
||||
|
||||
@classmethod
|
||||
def is_approved(cls, bigchain, new_height, txns):
|
||||
votes = {}
|
||||
@ -247,6 +256,3 @@ class Election(Transaction):
|
||||
@classmethod
|
||||
def on_approval(cls, bigchain, election, new_height):
|
||||
raise NotImplementedError
|
||||
|
||||
def show_election(self, bigchain):
|
||||
raise NotImplementedError
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user