mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
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:
parent
4a631ef3ae
commit
560a8154b7
@ -300,7 +300,7 @@ def get_validator_set(conn, height=None):
|
|||||||
|
|
||||||
|
|
||||||
@register_query(LocalMongoDBConnection)
|
@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}
|
query = {'election_id': election_id}
|
||||||
|
|
||||||
cursor = conn.run(
|
cursor = conn.run(
|
||||||
|
|||||||
@ -361,7 +361,7 @@ def get_validator_set(conn, height):
|
|||||||
|
|
||||||
|
|
||||||
@singledispatch
|
@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
|
"""Return a validator set change with the specified election_id
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -221,7 +221,7 @@ class Election(Transaction):
|
|||||||
return self.ONGOING
|
return self.ONGOING
|
||||||
|
|
||||||
def get_election_result(self, election_id, bigchain):
|
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
|
return result
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@ -430,7 +430,7 @@ class BigchainDB(object):
|
|||||||
return validators
|
return validators
|
||||||
|
|
||||||
def get_result_by_election_id(self, election_id, table):
|
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
|
return result
|
||||||
|
|
||||||
def store_pre_commit_state(self, state):
|
def store_pre_commit_state(self, state):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user