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

Add new troubleshooting section for generating abi for maps #149

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/08_troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,39 @@ assertion failure with message: system contract must first be initialized

The failure is stating that `eosio.system` `init` action was not called yet. The `init` action is implemented by the `void init(uint64_t, symbol)` function. The first parameter is the version, this should always be `0` for now, until a new version of `init` will be created that handles more information.
The second parameter is the system's symbol (i.e. for main net this is `EOS`). If you followed the [BIOS Boot Sequence](https://docs.eosnetwork.com/docs/latest/tutorials/bios-boot-sequence) tutorial and created a system with the default symbol `SYS` then `SYS` shall be used as the system's symbol in the `init` action. It is whatever symbol you as the chain creator want to use in your `Antelope` based blockchain.

## Backward incompatible change in generating abi for maps

In CDT version 3.0.1, there has been a backward incompatible change in generating ABI for std::map. The change is as follows:
mikelik marked this conversation as resolved.
Show resolved Hide resolved

Old Version (CDT 3.0.0 or earlier):
```
"fields": [
{
"name": "key",
"type": "<map first type>"
},
{
"name": "value",
"type": "<map second type>"
}
]
```

New Version (CDT 3.0.1 and above):
```
"fields": [
{
"name": "first",
"type": "<map first type>"
},
{
"name": "second",
"type": "<map second type>"
}
]
```

As a result, if you are using code based on CDT 3.0.0 or earlier, you may encounter errors when upgrading to CDT 3.0.1 and above.
An example error message could be: `Error: missing pair_uint64_bytes.first (type=uint64)`.
To resolve this issue, you need to update your code to use `first` and `second` to access the elements of `std::map`, instead of the old `key` and `value` identifiers.