mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fix mongodb write_block without thouching mongodb code
This commit is contained in:
parent
1d7a8e3369
commit
71bb63376f
@ -134,7 +134,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