Problem: Responding to a suggestion for improved method naming

Solution: Refactored `get_result_by_election_id` to `get_election_result_by_id`
This commit is contained in:
z-bowen 2018-09-03 12:00:06 +02:00
parent 4a631ef3ae
commit 560a8154b7
4 changed files with 4 additions and 4 deletions

View File

@ -300,7 +300,7 @@ def get_validator_set(conn, height=None):
@register_query(LocalMongoDBConnection)
def get_result_by_election_id(conn, election_id, table):
def get_election_result_by_id(conn, election_id, table):
query = {'election_id': election_id}
cursor = conn.run(

View File

@ -361,7 +361,7 @@ def get_validator_set(conn, height):
@singledispatch
def get_result_by_election_id(conn, election_id, table):
def get_election_result_by_id(conn, election_id, table):
"""Return a validator set change with the specified election_id
"""

View File

@ -221,7 +221,7 @@ class Election(Transaction):
return self.ONGOING
def get_election_result(self, election_id, bigchain):
result = bigchain.get_result_by_election_id(election_id, self.DB_TABLE)
result = bigchain.get_election_result_by_id(election_id, self.DB_TABLE)
return result
@classmethod

View File

@ -430,7 +430,7 @@ class BigchainDB(object):
return validators
def get_result_by_election_id(self, election_id, table):
result = backend.query.get_result_by_election_id(self.connection, election_id, table)
result = backend.query.get_election_result_by_id(self.connection, election_id, table)
return result
def store_pre_commit_state(self, state):