fixed some more test cases

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2023-01-03 16:10:50 +01:00
parent f5e83f7110
commit 7d984007b6
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A
3 changed files with 9 additions and 4 deletions

View File

@ -5,8 +5,10 @@
CHAIN_MIGRATION_ELECTION = "CHAIN_MIGRATION_ELECTION" CHAIN_MIGRATION_ELECTION = "CHAIN_MIGRATION_ELECTION"
VALIDATOR_ELECTION = "VALIDATOR_ELECTION" VALIDATOR_ELECTION = "VALIDATOR_ELECTION"
VOTE = "VOTE"
GOVERNANCE_TRANSACTION_TYPES = [ GOVERNANCE_TRANSACTION_TYPES = [
CHAIN_MIGRATION_ELECTION, CHAIN_MIGRATION_ELECTION,
VALIDATOR_ELECTION VALIDATOR_ELECTION,
VOTE
] ]

View File

@ -17,7 +17,6 @@ class FastQuery:
def get_outputs_by_public_key(self, public_key): def get_outputs_by_public_key(self, public_key):
"""Get outputs for a public key""" """Get outputs for a public key"""
txs = query.get_owned_ids(self.connection, public_key) txs = query.get_owned_ids(self.connection, public_key)
print(txs)
return [ return [
TransactionLink(tx.id, index) TransactionLink(tx.id, index)
for tx in txs for tx in txs

View File

@ -145,7 +145,6 @@ class Planetmint(object):
for t in transactions: for t in transactions:
transaction = t.tx_dict if t.tx_dict else rapidjson.loads(rapidjson.dumps(t.to_dict())) 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: if transaction["operation"] in GOVERNANCE_TRANSACTION_TYPES:
gov_txns.append(transaction) gov_txns.append(transaction)
else: else:
@ -377,9 +376,14 @@ class Planetmint(object):
# store the inputs so that we can check if the asset ids match # store the inputs so that we can check if the asset ids match
input_txs = [] input_txs = []
input_conditions = [] input_conditions = []
table = TARANT_TABLE_TRANSACTION
if tx.operation in GOVERNANCE_TRANSACTION_TYPES:
table = TARANT_TABLE_GOVERNANCE
for input_ in tx.inputs: for input_ in tx.inputs:
input_txid = input_.fulfills.txid 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) _output = self.get_outputs_by_tx_id(input_txid)
if input_tx is None: if input_tx is None:
for ctxn in current_transactions: for ctxn in current_transactions: