Expand abbrevation "txn" to transaction

This commit is contained in:
kansi 2017-12-13 11:05:28 +05:30
parent cb92248855
commit afd643c41d
4 changed files with 10 additions and 10 deletions

View File

@ -43,10 +43,10 @@ def store_metadata(conn, metadata):
@register_query(LocalMongoDBConnection)
def get_metadata(conn, txn_ids):
def get_metadata(conn, transaction_ids):
return conn.run(
conn.collection('metadata')
.find({'id': {'$in': txn_ids}},
.find({'id': {'$in': transaction_ids}},
projection={'_id': False}))

View File

@ -94,7 +94,7 @@ def create_metadata_secondary_index(conn, dbname):
# the id is the txid of the transaction where metadata was defined
conn.conn[dbname]['metadata'].create_index('id',
name='txn_id',
name='transaction_id',
unique=True)
# full text search index

View File

@ -35,10 +35,10 @@ def store_asset(connection, asset):
@singledispatch
def store_metadata(connection, metadata):
"""Write an asset to the asset table.
"""Write metadata to the metadata table.
Args:
asset (dict): the asset.
metadata (dict): transaction metadata.
Returns:
The result of the operation.
@ -345,11 +345,11 @@ def get_assets(connection, asset_ids):
@singledispatch
def get_metadata(connection, txn_ids):
def get_metadata(connection, transaction_ids):
"""Get a list of metadata from the metadata table.
Args:
txn_ids (list): a list of ids for the metadata to be retrieved from
transaction_ids (list): a list of ids for the metadata to be retrieved from
the database.
Returns:

View File

@ -52,10 +52,10 @@ class BigchainDB(Bigchain):
backend.query.store_asset(self.connection, asset)
metadata = transaction.pop('metadata')
txn_metadata = {'id': transaction['id'],
'metadata': metadata}
transaction_metadata = {'id': transaction['id'],
'metadata': metadata}
backend.query.store_metadata(self.connection, [txn_metadata])
backend.query.store_metadata(self.connection, [transaction_metadata])
return backend.query.store_transaction(self.connection, transaction)