Skip to content

DeserializeException: ['list'] typed value is required for deserialization. Got <class 'tuple'> #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nullhashpixel opened this issue Jan 4, 2025 · 1 comment

Comments

@nullhashpixel
Copy link
Contributor

Describe the bug

deserialization of some real mainnet txs fails:

Traceback (most recent call last):
  File "./test_pycardano.py", line 6, in <module>
    tx = Transaction.from_cbor(tx_cbor)
  File "/site-packages/pycardano/serialization.py", line 485, in from_cbor
    return cls.from_primitive(value)
  File "/site-packages/pycardano/serialization.py", line 162, in wrapper
    return func(cls, value)
  File "/site-packages/pycardano/serialization.py", line 681, in from_primitive
    v = _restore_dataclass_field(f, v)
  File "/site-packages/pycardano/serialization.py", line 506, in _restore_dataclass_field
    return _restore_typed_primitive(f.type, v)
  File "/site-packages/pycardano/serialization.py", line 524, in _restore_typed_primitive
    return t.from_primitive(v)
  File "/site-packages/pycardano/serialization.py", line 162, in wrapper
    return func(cls, value)
  File "/site-packages/pycardano/serialization.py", line 794, in from_primitive
    v = _restore_dataclass_field(f, v)
  File "/site-packages/pycardano/serialization.py", line 505, in _restore_dataclass_field
    return f.metadata["object_hook"](v)
  File "/site-packages/pycardano/serialization.py", line 939, in <lambda>
    return lambda vals: [cls.from_primitive(v) for v in vals]
  File "/site-packages/pycardano/serialization.py", line 939, in <listcomp>
    return lambda vals: [cls.from_primitive(v) for v in vals]
  File "/site-packages/pycardano/serialization.py", line 159, in wrapper
    raise DeserializeException(
pycardano.exception.DeserializeException: ['list'] typed value is required for deserialization. Got <class 'tuple'>: (b'\xf8\xbb\x88\xc6\xe4\xdd\x90+\n\xe6}\xe5<\xe3\xc4\xa8D\xb3$\xd3\x19\xb8%lx\xb5:\xc3f\xe9\xaaF', b'\xc8yzvj\x03\x81e\x1f\xe2\tr\x8b\x89\xa1\xaa\xd4\xaa\xe1\x92\x89W\xb1\xe4>\x98\xfd\xedr\xe2[HN\x83y\x8e\xd4\x9c\xc4Ofu\x0ej=H\xc5`e\x00p\xc5\xdc4Mn\xe8\xf5\xcb7\xfeam\x06')

To Reproduce

this is a random valid tx from mainnet which produces the error:

from pycardano import *

tx_cbor = "84a500d90102828258200b10bccbc38591d528c5a41cf730e269060300c6fde178329e77edaf0524251c008258203c6049358481ce8c1d3e80260624b3cd1778ec750f8e5e2d73adaac8d72a7da2010183a300583911c3e28c36c3447315ba5a56f33da6a6ddc1770a876a8d9f0cb3a97c4c7e74b31fac7c8b298ff4aa5942048de9718aa0a1a2be70f5083c888001821a003d0900a1581c29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6a1434d494e1ac6bc868b028201d818590130d8799fd8799f581c469da0a89b4a07162714fe15ba0c4d16dcf5867b6d1fff6d9d7bd02cffd8799fd8799f581c469da0a89b4a07162714fe15ba0c4d16dcf5867b6d1fff6d9d7bd02cffd8799fd8799fd8799f581c7e74b31fac7c8b298ff4aa5942048de9718aa0a1a2be70f5083c8880ffffffffd87980d8799fd8799f581c469da0a89b4a07162714fe15ba0c4d16dcf5867b6d1fff6d9d7bd02cffd8799fd8799fd8799f581c7e74b31fac7c8b298ff4aa5942048de9718aa0a1a2be70f5083c8880ffffffffd87980d8799f581cf5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c582082e2b1fd27a7712a1a9cf750dfbea1a5778611b20e06dd6a611df7a643f8cb75ffd8799fd87980d8799f1ac6bc868bff1a096ea450d87980ff1a001e8480d87a80ff82583901469da0a89b4a07162714fe15ba0c4d16dcf5867b6d1fff6d9d7bd02c7e74b31fac7c8b298ff4aa5942048de9718aa0a1a2be70f5083c88801a01386ccc82583901469da0a89b4a07162714fe15ba0c4d16dcf5867b6d1fff6d9d7bd02c7e74b31fac7c8b298ff4aa5942048de9718aa0a1a2be70f5083c8880821a004cbc6cb2581c02a574e2f048e288e2a77f48872bf8ffd61d73f9476ac5a83601610ba1401b0000000199741f63581c098acff2feb062d4ec63e26d7fec90b7a1467873fdbec3bb0dba1bc5a146724f5054494d01581c09f2d4e4a5c3662f4c1e6a7d9600e9605279dbdcedb22d4507cb6e75a1435350461acba294ab581c1ddcb9c9de95361565392c5bdff64767492d61a96166cb16094e54bea1434f50541a6d49a7b6581c25a549dffe519c58fb88f0c794f08a6b64f9e5aa505c4c09e3ffffb8a1535350465265776172645469636b657432303234193e80581c339edcad633af825c1bb24d2b4277c63d3ca84357c1e27177b42b2dfa144544d494e01581c4c2f0fce805a0aae2b3fe214cbc39d5fd03799ee6d2a7718b9df9b04a14d53504c4153485f4144415f4c511a63e8d57f581c66e0d5513a0ead757b7a8318069c7003c85519c21a23442bbd6286a3a14441574d5401581c803667cdfe95627cb3ab47c54fe3766ffe4e7090c78c0317a7ae2911a14c50414c4d4953504f3035393101581c9e975c76508686eb2d57985dbaea7e3843767a31b4dcf4e99e564683a1444d41595a1b00000001292ab10d581ca6b2a5cda74f4bc6219cf5f3fe66389853f40a489e503bc27fdaea71a14454574d5401581caee0a0bc7f5063cec94e9e11d94e386e081aecf324be8250b613c51ca145724147495801581ce5a42a1a1d3d1da71b0449663c32798725888d2eb0843c4dabeca05aa151576f726c644d6f62696c65546f6b656e581a9b2fc345581cececc92aeaaac1f5b665f567b01baec8bc2771804b4c21716a87a4e3a14653504c4153481b00000003236fc312581cedfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e99344479a1434e54581a2376cd36581cf0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9aa34361716801486171682e64616e6101496171682e6f7074696d01581cf7516c9f7b347eb412a777f3c711099b199ccd2be23b568a4a3abf6da1435350581a16566938581cfcad3f8a7e27b9cbde9d49a3de830f65085b35cc5090fa796b0760e4a1474f5054494d697a1b0000000105b09784021a000373d9031a089c05b50758201feb00f18fbe772cc375aa495da0b08d837a719671e68da62f8ed658915d8fd1a100d9010281825820f8bb88c6e4dd902b0ae67de53ce3c4a844b324d319b8256c78b53ac366e9aa465840c8797a766a0381651fe209728b89a1aad4aae1928957b1e43e98fded72e25b484e83798ed49cc44f66750e6a3d48c560650070c5dc344d6ee8f5cb37fe616d06f5a11902a2a1636d736781754d696e737761703a204d61726b6574204f72646572"

tx = Transaction.from_cbor(tx_cbor)

Environment and software version (please complete the following information):

  • Python 3.8
  • PyCardano Version 0.12.2
@cffls
Copy link
Collaborator

cffls commented Jan 4, 2025

Closing this as the fix is merged.

@cffls cffls closed this as completed Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants