We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab01bec commit c489984Copy full SHA for c489984
pycardano/plutus.py
@@ -589,6 +589,23 @@ def _dfs(obj):
589
raise DeserializeException(
590
f"Unexpected data structure: {f}."
591
)
592
+ elif (
593
+ hasattr(f_info.type, "__origin__")
594
+ and f_info.type.__origin__ is list
595
+ ):
596
+ t_args = f_info.type.__args__
597
+ if len(t_args) != 1:
598
+ raise DeserializeException(f"List types need exactly one type argument, but got {t_args}")
599
+ if not "list" in f:
600
+ raise DeserializeException(f"Expected type \"list\" for constructor List but got {f}")
601
+ t = t_args[0]
602
+ if (
603
+ inspect.isclass(t)
604
+ and issubclass(t, PlutusData)
605
606
+ converted_fields.append(t.from_dict(f))
607
+ else:
608
+ converted_fields.append(_dfs(f))
609
else:
610
converted_fields.append(_dfs(f))
611
return cls(*converted_fields)
0 commit comments