py-algorand-sdk icon indicating copy to clipboard operation
py-algorand-sdk copied to clipboard

algosdk.error.ABITypeError: cannot convert account to an ABI type

Open rocalex opened this issue 2 years ago • 1 comments

File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/contract.py", line 26, in <module>
    def add(a: abi.DynamicArray[abi.Account]):
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/src/pyteal/pyteal/ast/router.py", line 659, in method
    return wrap(func)
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/src/pyteal/pyteal/ast/router.py", line 653, in wrap
    return self.add_method_handler(
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/src/pyteal/pyteal/ast/router.py", line 573, in add_method_handler
    meth = method_call.method_spec()
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/src/pyteal/pyteal/ast/subroutine.py", line 640, in method_spec
    return sdk_abi.Method.undictify(spec)
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/method.py", line 123, in undictify
    arg_list = [Argument.undictify(arg) for arg in d["args"]]
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/method.py", line 123, in <listcomp>
    arg_list = [Argument.undictify(arg) for arg in d["args"]]
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/method.py", line 192, in undictify
    return Argument(
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/method.py", line 167, in __init__
    self.type = abi.ABIType.from_string(arg_type)
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/base_type.py", line 75, in from_string
    array_arg_type = ABIType.from_string(s[:-2])
  File "/Volumes/DATA/SourceCode/chimerax-org/abi-demo/venv/lib/python3.10/site-packages/algosdk/abi/base_type.py", line 137, in from_string
    raise error.ABITypeError(
algosdk.error.ABITypeError: cannot convert account to an ABI type

rocalex avatar Jul 18 '22 18:07 rocalex

Thank you for making us aware of this. This may be because the SDK does not yet support embedding reference types in arrays/tuples.

jasonpaulos avatar Jul 19 '22 21:07 jasonpaulos