mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Hardcoded reference to the VOTE_TYPE in Election base class
Solution: Pointed the reference to the class variable
This commit is contained in:
parent
30a5b9374d
commit
7d756bf1a9
@ -162,7 +162,7 @@ class Election(Transaction):
|
|||||||
def count_votes(cls, election_pk, transactions, getter=getattr):
|
def count_votes(cls, election_pk, transactions, getter=getattr):
|
||||||
votes = 0
|
votes = 0
|
||||||
for txn in transactions:
|
for txn in transactions:
|
||||||
if getter(txn, 'operation') == 'VOTE':
|
if getter(txn, 'operation') == cls.VOTE_TYPE:
|
||||||
for output in getter(txn, 'outputs'):
|
for output in getter(txn, 'outputs'):
|
||||||
# NOTE: We enforce that a valid vote to election id will have only
|
# NOTE: We enforce that a valid vote to election id will have only
|
||||||
# election_pk in the output public keys, including any other public key
|
# election_pk in the output public keys, including any other public key
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user