mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
fixed test_core.py by adding HDict in saved_key_orders function
Signed-off-by: Sangat Das <sangatdas5@gmail.com>
This commit is contained in:
parent
255d1ee49a
commit
6a243743f4
@ -1,10 +1,11 @@
|
||||
from secrets import token_hex
|
||||
import copy
|
||||
from planetmint.common.memoize import HDict
|
||||
|
||||
|
||||
def _save_keys_order(dictionary):
|
||||
filter_keys = ["asset", "metadata"]
|
||||
if type(dictionary) is dict:
|
||||
if type(dictionary) is dict or type(dictionary) is HDict:
|
||||
keys = list(dictionary.keys())
|
||||
_map = {}
|
||||
for key in keys:
|
||||
@ -35,7 +36,6 @@ class TransactionDecompose:
|
||||
"metadata": None,
|
||||
"asset": None
|
||||
}
|
||||
# print(f"Transaction ::::: {self._transaction}")
|
||||
|
||||
def get_map(self, dictionary: dict = None):
|
||||
|
||||
@ -115,10 +115,11 @@ class TransactionDecompose:
|
||||
return _keys, _outputs
|
||||
|
||||
def __prepare_transaction(self):
|
||||
_map = self.get_map()
|
||||
return (self._transaction["id"],
|
||||
self._transaction["operation"],
|
||||
self._transaction["version"],
|
||||
self.get_map())
|
||||
_map)
|
||||
|
||||
def convert_to_tuple(self):
|
||||
self._metadata_check()
|
||||
|
||||
@ -293,7 +293,6 @@ def test_deliver_tx__double_spend_fails(a, b, init_chain_request):
|
||||
|
||||
app.end_block(types.RequestEndBlock(height=99))
|
||||
app.commit()
|
||||
|
||||
assert b.get_transaction(tx.id).id == tx.id
|
||||
result = app.deliver_tx(encode_tx_to_bytes(tx))
|
||||
assert result.code == CodeTypeError
|
||||
|
||||
@ -7,7 +7,6 @@ from unittest.mock import patch
|
||||
import pytest
|
||||
|
||||
from planetmint.backend import query
|
||||
# from planetmint.backend.localmongodb import query
|
||||
from planetmint.upsert_validator import ValidatorElection
|
||||
|
||||
|
||||
@ -46,6 +45,3 @@ def inconclusive_election(b, ongoing_validator_election, new_validator):
|
||||
query.store_validator_set(b.connection, validator_update)
|
||||
return ongoing_validator_election
|
||||
|
||||
|
||||
# ERROR tests/upsert_validator/test_validator_election.py::test_get_status_concluded - AttributeError: 'TarantoolDB' object has no attribute 'run'
|
||||
# ERROR tests/upsert_validator/test_validator_election.py::test_get_status_inconclusive - AttributeError: 'TarantoolDB' object has no attribute 'run'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user