mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 06:55:45 +00:00
fixed some minor bugs
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
6a980c075f
commit
084d566fe8
@ -100,6 +100,9 @@ def get_transactions(connection, transactions_ids: list):
|
||||
def store_metadatas(connection, metadata: list):
|
||||
space = connection.space("meta_data")
|
||||
for meta in metadata:
|
||||
print(f"METADATA : {meta}")
|
||||
data = meta["data"] if not "metadata" in meta else meta["metadata"]
|
||||
if data:
|
||||
space.insert((meta["id"], meta["data"] if not "metadata" in meta else meta["metadata"]))
|
||||
|
||||
|
||||
@ -109,6 +112,7 @@ def get_metadata(connection, transaction_ids: list):
|
||||
space = connection.space("meta_data")
|
||||
for _id in transaction_ids:
|
||||
metadata = space.select(_id, index="id_search")
|
||||
print(f"METADATA : {metadata}")
|
||||
_returned_data.append({"id": metadata.data[0][0], "metadata": metadata.data[0][1]})
|
||||
return _returned_data
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ from planetmint.common.exceptions import DatabaseDoesNotExist
|
||||
from planetmint.lib import Block
|
||||
from tests.utils import gen_vote
|
||||
from planetmint.config import Config
|
||||
from planetmint.upsert_validator import ValidatorElection
|
||||
|
||||
TEST_DB_NAME = 'planetmint_test'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user