mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Use new connection class in pipeline
This commit is contained in:
parent
7097efaa33
commit
52243e1271
@ -53,10 +53,10 @@ class Block:
|
|||||||
Returns:
|
Returns:
|
||||||
The transaction.
|
The transaction.
|
||||||
"""
|
"""
|
||||||
r.table('backlog')\
|
self.bigchain.connection.run(
|
||||||
.get(tx['id'])\
|
r.table('backlog')
|
||||||
.delete(durability='hard')\
|
.get(tx['id'])
|
||||||
.run(self.bigchain.conn)
|
.delete(durability='hard'))
|
||||||
|
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
@ -118,12 +118,14 @@ def initial():
|
|||||||
|
|
||||||
b = Bigchain()
|
b = Bigchain()
|
||||||
|
|
||||||
rs = r.table('backlog')\
|
rs = b.connection.run(
|
||||||
.between([b.me, r.minval],
|
r.table('backlog')
|
||||||
|
.between(
|
||||||
|
[b.me, r.minval],
|
||||||
[b.me, r.maxval],
|
[b.me, r.maxval],
|
||||||
index='assignee__transaction_timestamp')\
|
index='assignee__transaction_timestamp')
|
||||||
.order_by(index=r.asc('assignee__transaction_timestamp'))\
|
.order_by(index=r.asc('assignee__transaction_timestamp')))
|
||||||
.run(b.conn)
|
|
||||||
return rs
|
return rs
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,9 +25,10 @@ class Election:
|
|||||||
"""
|
"""
|
||||||
Checks if block has enough invalid votes to make a decision
|
Checks if block has enough invalid votes to make a decision
|
||||||
"""
|
"""
|
||||||
next_block = r.table('bigchain')\
|
next_block = self.bigchain.connection.run(
|
||||||
.get(next_vote['vote']['voting_for_block'])\
|
r.table('bigchain')
|
||||||
.run(self.bigchain.conn)
|
.get(next_vote['vote']['voting_for_block']))
|
||||||
|
|
||||||
if self.bigchain.block_election_status(next_block) == self.bigchain.BLOCK_INVALID:
|
if self.bigchain.block_election_status(next_block) == self.bigchain.BLOCK_INVALID:
|
||||||
return next_block
|
return next_block
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user