mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 22:45:44 +00:00
changed from string to number data type for field asset_id
This commit is contained in:
parent
f9ae8de688
commit
e7c18545b3
@ -132,7 +132,10 @@ def get_metadata(transaction_ids: list, space):
|
||||
def store_asset(asset: dict, connection):
|
||||
space = connection.space("assets")
|
||||
unique = token_hex(8)
|
||||
space.insert((str(asset["id"]), unique, asset["data"]))
|
||||
try:
|
||||
space.insert((asset["id"], unique, asset["data"]))
|
||||
except: # TODO Add Raise For Duplicate
|
||||
pass
|
||||
|
||||
|
||||
# @register_query(LocalMongoDBConnection)
|
||||
@ -140,7 +143,7 @@ def store_assets(assets: list, connection):
|
||||
space = connection.space("assets")
|
||||
for asset in assets:
|
||||
unique = token_hex(8)
|
||||
space.insert((str(asset["id"]), unique, asset["data"]))
|
||||
space.insert((asset["id"], unique, asset["data"]))
|
||||
|
||||
|
||||
# @register_query(LocalMongoDBConnection)
|
||||
|
||||
@ -62,7 +62,7 @@ def test_write_assets():
|
||||
documents = query.get_assets(assets_ids=[asset["id"] for asset in assets], connection=conn)
|
||||
|
||||
assert len(documents) == 3
|
||||
# assert list(cursor) == assets[:-1] # TODO To change from id 'string' to 'unsigned'
|
||||
assert list(documents) == assets[:-1]
|
||||
|
||||
|
||||
def test_get_assets():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user