mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
vote.id doesn't exist in server
This commit is contained in:
parent
b227739d89
commit
ecbeaa0b25
@ -230,7 +230,8 @@ class RethinkDBBackend:
|
||||
"""
|
||||
return self.connection.run(
|
||||
r.table('votes', read_mode=self.read_mode)
|
||||
.between([block_id, r.minval], [block_id, r.maxval], index='block_and_voter'))
|
||||
.between([block_id, r.minval], [block_id, r.maxval], index='block_and_voter')
|
||||
.without('id'))
|
||||
|
||||
def get_votes_by_block_id_and_voter(self, block_id, node_pubkey):
|
||||
"""Get all the votes casted for a specific block by a specific voter.
|
||||
@ -244,7 +245,8 @@ class RethinkDBBackend:
|
||||
"""
|
||||
return self.connection.run(
|
||||
r.table('votes', read_mode=self.read_mode)
|
||||
.get_all([block_id, node_pubkey], index='block_and_voter'))
|
||||
.get_all([block_id, node_pubkey], index='block_and_voter')
|
||||
.without('id'))
|
||||
|
||||
def write_block(self, block, durability='soft'):
|
||||
"""Write a block to the bigchain table.
|
||||
|
@ -4,7 +4,6 @@ A vote has the following structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "<RethinkDB-generated ID for the vote>",
|
||||
"node_pubkey": "<the public key of the voting node>",
|
||||
"vote": {
|
||||
"voting_for_block": "<id of the block the node is voting for>",
|
||||
|
Loading…
x
Reference in New Issue
Block a user