mirror of
https://github.com/planetmint/planetmint.git
synced 2025-06-07 14:46:38 +00:00
fixed object differentiation issue in eventify_block (#350)
* fixed object differentiation issue in eventify_block Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
59f25687da
commit
8942ebe4af
@ -57,8 +57,12 @@ class Dispatcher:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def eventify_block(block):
|
def eventify_block(block):
|
||||||
for tx in block["transactions"]:
|
for tx in block["transactions"]:
|
||||||
if tx.assets:
|
asset_ids = []
|
||||||
asset_ids = [asset.get("id", tx.id) for asset in tx.assets]
|
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:
|
else:
|
||||||
asset_ids = [tx.id]
|
asset_ids = [tx.id]
|
||||||
yield {"height": block["height"], "asset_ids": asset_ids, "transaction_id": tx.id}
|
yield {"height": block["height"], "asset_ids": asset_ids, "transaction_id": tx.id}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user