From 7d984007b62fb3b65a61d05a11fd481cc1b8057b Mon Sep 17 00:00:00 2001 From: Lorenz Herzberger Date: Tue, 3 Jan 2023 16:10:50 +0100 Subject: [PATCH] fixed some more test cases Signed-off-by: Lorenz Herzberger --- planetmint/const.py | 4 +++- planetmint/fastquery.py | 1 - planetmint/lib.py | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/planetmint/const.py b/planetmint/const.py index ea7282c..bad9f72 100644 --- a/planetmint/const.py +++ b/planetmint/const.py @@ -5,8 +5,10 @@ CHAIN_MIGRATION_ELECTION = "CHAIN_MIGRATION_ELECTION" VALIDATOR_ELECTION = "VALIDATOR_ELECTION" +VOTE = "VOTE" GOVERNANCE_TRANSACTION_TYPES = [ CHAIN_MIGRATION_ELECTION, - VALIDATOR_ELECTION + VALIDATOR_ELECTION, + VOTE ] diff --git a/planetmint/fastquery.py b/planetmint/fastquery.py index 62496a6..0baba95 100644 --- a/planetmint/fastquery.py +++ b/planetmint/fastquery.py @@ -17,7 +17,6 @@ class FastQuery: def get_outputs_by_public_key(self, public_key): """Get outputs for a public key""" txs = query.get_owned_ids(self.connection, public_key) - print(txs) return [ TransactionLink(tx.id, index) for tx in txs diff --git a/planetmint/lib.py b/planetmint/lib.py index d72a20c..e4e8c1b 100644 --- a/planetmint/lib.py +++ b/planetmint/lib.py @@ -145,7 +145,6 @@ class Planetmint(object): for t in transactions: transaction = t.tx_dict if t.tx_dict else rapidjson.loads(rapidjson.dumps(t.to_dict())) - print(transaction["operation"]) if transaction["operation"] in GOVERNANCE_TRANSACTION_TYPES: gov_txns.append(transaction) else: @@ -377,9 +376,14 @@ class Planetmint(object): # store the inputs so that we can check if the asset ids match input_txs = [] input_conditions = [] + + table = TARANT_TABLE_TRANSACTION + if tx.operation in GOVERNANCE_TRANSACTION_TYPES: + table = TARANT_TABLE_GOVERNANCE + for input_ in tx.inputs: input_txid = input_.fulfills.txid - input_tx = self.get_transaction(input_txid) + input_tx = self.get_transaction(input_txid, table) _output = self.get_outputs_by_tx_id(input_txid) if input_tx is None: for ctxn in current_transactions: