mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #979 from bigchaindb/bug-mongodb-write-block
fix mongodb write_block
This commit is contained in:
commit
83d37d699f
@ -144,7 +144,7 @@ def get_votes_by_block_id_and_voter(connection, block_id, node_pubkey):
|
|||||||
def write_block(connection, block):
|
def write_block(connection, block):
|
||||||
return connection.run(
|
return connection.run(
|
||||||
r.table('bigchain')
|
r.table('bigchain')
|
||||||
.insert(r.json(block), durability=WRITE_DURABILITY))
|
.insert(r.json(block.to_str()), durability=WRITE_DURABILITY))
|
||||||
|
|
||||||
|
|
||||||
@register_query(RethinkDBConnection)
|
@register_query(RethinkDBConnection)
|
||||||
|
@ -516,7 +516,7 @@ class Bigchain(object):
|
|||||||
block (Block): block to write to bigchain.
|
block (Block): block to write to bigchain.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return backend.query.write_block(self.connection, block.to_str())
|
return backend.query.write_block(self.connection, block)
|
||||||
|
|
||||||
def transaction_exists(self, transaction_id):
|
def transaction_exists(self, transaction_id):
|
||||||
return backend.query.has_transaction(self.connection, transaction_id)
|
return backend.query.has_transaction(self.connection, transaction_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user