From b1501ef51e9571c08b7b5f763b5ecb630673effe Mon Sep 17 00:00:00 2001 From: andrei Date: Wed, 27 Apr 2022 15:00:18 +0300 Subject: [PATCH] hash problem fixed --- planetmint/backend/tarantool/transaction/tools.py | 4 ++-- planetmint/common/transaction.py | 1 - planetmint/lib.py | 1 - tests/assets/test_divisible_assets.py | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/planetmint/backend/tarantool/transaction/tools.py b/planetmint/backend/tarantool/transaction/tools.py index d15b1ff..8d3ac64 100644 --- a/planetmint/backend/tarantool/transaction/tools.py +++ b/planetmint/backend/tarantool/transaction/tools.py @@ -163,7 +163,7 @@ class TransactionCompose: def _get_inputs(self): _inputs = [] for _input in self.db_results["inputs"]: - _in = copy.deepcopy(self._map["inputs"]) + _in = copy.deepcopy(self._map["inputs"][_input[-1]]) _in["fulfillment"] = _input[1] if _in["fulfills"] is not None: _in["fulfills"]["transaction_id"] = _input[3] @@ -176,7 +176,7 @@ class TransactionCompose: _outputs = [] for _output in self.db_results["outputs"]: # print (f"\noutput : {_output}") - _out = copy.deepcopy(self._map["outputs"]) + _out = copy.deepcopy(self._map["outputs"][_output[-1]]) _out["amount"] = _output[1] _tmp_keys = [(_key[3], _key[4]) for _key in self.db_results["keys"] if _key[2] == _output[5]] _sorted_keys = sorted(_tmp_keys, key=lambda tup: (tup[1])) diff --git a/planetmint/common/transaction.py b/planetmint/common/transaction.py index c6a8d97..03039ff 100644 --- a/planetmint/common/transaction.py +++ b/planetmint/common/transaction.py @@ -1308,7 +1308,6 @@ class Transaction(object): for input_ in self.inputs: input_txid = input_.fulfills.txid input_tx = planet.get_transaction(input_txid) - print(f"\ninput_tx ------ {input_tx.to_dict()} -------") if input_tx is None: for ctxn in current_transactions: if ctxn.id == input_txid: diff --git a/planetmint/lib.py b/planetmint/lib.py index 8574615..5f7616e 100644 --- a/planetmint/lib.py +++ b/planetmint/lib.py @@ -245,7 +245,6 @@ class Planetmint(object): def get_transaction(self, transaction_id): transaction = backend.query.get_transaction(self.connection, transaction_id) - print(f"transaction_from_db ::::::: {transaction} :::::::::") # if transaction: # asset = backend.query.get_asset(self.connection, transaction_id) # metadata = backend.query.get_metadata(self.connection, [transaction_id]) diff --git a/tests/assets/test_divisible_assets.py b/tests/assets/test_divisible_assets.py index a43ef7a..d3707ff 100644 --- a/tests/assets/test_divisible_assets.py +++ b/tests/assets/test_divisible_assets.py @@ -402,14 +402,12 @@ def test_muiltiple_in_mix_own_multiple_out_mix_own_transfer(alice, b, user_pk, tx_create = Transaction.create([alice.public_key], [([user_pk], 50), ([user_pk, alice.public_key], 50)], asset={'name': random.random()}) tx_create_signed = tx_create.sign([alice.private_key]) - print(f"\ninit_tx_create ======= {tx_create_signed.to_dict()} ========") # TRANSFER tx_transfer = Transaction.transfer(tx_create.to_inputs(), [([alice.public_key], 50), ([alice.public_key, user_pk], 50)], asset_id=tx_create.id) tx_transfer_signed = tx_transfer.sign([alice.private_key, user_sk]) b.store_bulk_transactions([tx_create_signed]) - print(f"\ntx_transfer====== {tx_transfer_signed.to_dict()} ======") assert tx_transfer_signed.validate(b) == tx_transfer_signed assert len(tx_transfer_signed.outputs) == 2