File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,17 @@ def _restore_dataclass_field(
413
413
return f .metadata ["object_hook" ](v )
414
414
elif isclass (f .type ) and issubclass (f .type , CBORSerializable ):
415
415
return f .type .from_primitive (v )
416
+ elif hasattr (f .type , "__origin__" ) and (f .type .__origin__ is list ):
417
+ t_args = f .type .__args__
418
+ if len (t_args ) != 1 :
419
+ raise DeserializeException (
420
+ f"List types need exactly one type argument, but got { t_args } "
421
+ )
422
+ t = t_args [0 ]
423
+ if isclass (t ) and issubclass (t , CBORSerializable ):
424
+ return IndefiniteList ([t .from_primitive (w ) for w in v ])
425
+ else :
426
+ return IndefiniteList (v )
416
427
elif isclass (f .type ) and issubclass (f .type , IndefiniteList ):
417
428
return IndefiniteList (v )
418
429
elif hasattr (f .type , "__origin__" ) and (
Original file line number Diff line number Diff line change @@ -79,9 +79,6 @@ def test_plutus_data():
79
79
check_two_way_cbor (my_vesting )
80
80
81
81
82
- @unittest .skip (
83
- "From CBOR is generally not correctly implemented for tags > 7, so this test fails"
84
- )
85
82
def test_plutus_data_list_cbor ():
86
83
test = ListTest ([LargestTest (), LargestTest ()])
87
84
You can’t perform that action at this time.
0 commit comments