Skip to content
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

[3.0] fix is_explicit_nested in abi generator gen.hpp #23

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

linh2931
Copy link
Member

Resolve #15

is_explicit_nested determines if a type is nested. It currently just counts the number of <s and returns true if the number is greater than 1. This causes problems for types containing std::vector<char>, as std::vector<char> actually converted to bytes and should not be considered as a vector. For example, is_explicit_nested returns true for std::map<uint64_t,std::vector<char>> as a nested container and it leads to an ABI of

    "types": [
        {
            "new_type_name": "B_vector_int8_E",
            "type": "int8[]"
        }

This breaks existing users.

Change to determine nestedness semantically.

Change Description

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

is_explicit_nested currently returns true if number of < greater than 1, which treats
std::map<uint64_t,std::vector<char>> as nested. In fact std::map<uint64_t,std::vector<char>>
should be left alone and converted to std::map<uint64_t,bytes>. Change to determine nestedness semantically
@linh2931 linh2931 requested a review from larryk85 August 29, 2022 20:00
@arhag arhag linked an issue Aug 30, 2022 that may be closed by this pull request
@larryk85 larryk85 merged commit ed5bc61 into release/3.0 Aug 30, 2022
@larryk85 larryk85 deleted the fix_nested_container branch August 30, 2022 18:19
@larryk85 larryk85 mentioned this pull request Aug 30, 2022
2 tasks
larryk85 pushed a commit that referenced this pull request Aug 30, 2022
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

Successfully merging this pull request may close these issues.

error: Error: Unknown type: B_vector_int8_E
2 participants