mirror of
https://github.com/planetmint/planetmint.git
synced 2025-03-30 15:08:31 +00:00
fixed object differentiation issue in eventify_block
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
59f25687da
commit
d84516eb54
@ -57,8 +57,12 @@ class Dispatcher:
|
||||
@staticmethod
|
||||
def eventify_block(block):
|
||||
for tx in block["transactions"]:
|
||||
if tx.assets:
|
||||
asset_ids = [asset.get("id", tx.id) for asset in tx.assets]
|
||||
asset_ids = []
|
||||
if isinstance(tx.assets, dict):
|
||||
asset_ids.append(tx.assets)
|
||||
elif isinstance(tx.assets, list):
|
||||
for asset in tx.assets:
|
||||
asset_ids.append(asset.get("id", tx.id) )
|
||||
else:
|
||||
asset_ids = [tx.id]
|
||||
yield {"height": block["height"], "asset_ids": asset_ids, "transaction_id": tx.id}
|
||||
|
Loading…
x
Reference in New Issue
Block a user