Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

CDT does not generate correct ABI type for vector with a custom struct. #187

Closed
dixia opened this issue Oct 23, 2018 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dixia
Copy link
Contributor

dixia commented Oct 23, 2018

CDT does not generate correct ABI type for vector with a struct.

In the attached code, the type of the lock_asset is not correctly generated. I guess it is due to the type of vector is custom struct?

lt_contract.abi.txt
lt_contract.cpp.txt
lt_contract.hpp.txt

@dixia
Copy link
Contributor Author

dixia commented Oct 23, 2018

discovered by qui guacharo

@dixia
Copy link
Contributor Author

dixia commented Oct 23, 2018

@WhoAmI233

@andriantolie
Copy link
Contributor

I check it with primitive type (uint32_t), and it also generates the same problem, i.e.

      typedef vector<uint32_t> vector_of_uint32;
      TABLE sample {
        vector_of_uint32 v;
      };

results in

    "types": [
        {
            "new_type_name": "vector_of_uint32",
            "type": ">"
        }
    ],

Seems the problem is more generic and not just specific to custom struct.

@taokayan taokayan self-assigned this Oct 29, 2018
@taokayan taokayan added the bug Something isn't working label Oct 29, 2018
@lonkly
Copy link

lonkly commented Nov 2, 2018

optional <vector < string > > does not work as well

@taokayan
Copy link

taokayan commented Nov 5, 2018

optional <vector < string > > does not work as well

We don't support optional<vector<string> > at the moment because the current abi_serializer can't decode string[]?. The workaround is to make a struct as intermediate type.

@jeffreyssmith2nd
Copy link
Contributor

1.6.2 correctly handles the vector struct. Closing this issue in favor of #231 which can become the discussion place for the various nested containers and their support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants