Merge pull request #979 from bigchaindb/bug-mongodb-write-block

fix mongodb write_block
This commit is contained in:
Rodolphe Marques 2016-12-20 19:07:15 +01:00 committed by GitHub
commit 83d37d699f
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)