diff --git a/bigchaindb/elections/election.py b/bigchaindb/elections/election.py index fd5c2269..f5ee42bb 100644 --- a/bigchaindb/elections/election.py +++ b/bigchaindb/elections/election.py @@ -24,8 +24,6 @@ class Election(Transaction): # NOTE: this transaction class extends create so the operation inheritance is achieved # by setting an ELECTION_TYPE and renaming CREATE = ELECTION_TYPE and ALLOWED_OPERATIONS = (ELECTION_TYPE,) OPERATION = None - # the model for votes issued by the election - VOTE_TYPE = Vote # Custom validation schema TX_SCHEMA_CUSTOM = None # Election Statuses: @@ -166,7 +164,7 @@ class Election(Transaction): def count_votes(cls, election_pk, transactions, getter=getattr): votes = 0 for txn in transactions: - if getter(txn, 'operation') == cls.VOTE_TYPE.OPERATION: + if getter(txn, 'operation') == Vote.OPERATION: for output in getter(txn, 'outputs'): # 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 @@ -232,7 +230,7 @@ class Election(Transaction): def approved_update(cls, bigchain, new_height, txns): votes = {} for txn in txns: - if not isinstance(txn, cls.VOTE_TYPE): + if not isinstance(txn, Vote): continue election_id = txn.asset['id']